Qore Programming Language  0.8.11
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreSSLPrivateKey.h
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3  QC_SSLPrivateKey.h
4 
5  Qore Programming Language
6 
7  Copyright 2003 - 2013 David Nichols
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22  */
23 
24 #ifndef _QORE_QORESSLPRIVATEKEY_H
25 
26 #define _QORE_QORESSLPRIVATEKEY_H
27 
28 #include <openssl/ssl.h>
29 #include <openssl/evp.h>
30 
33 private:
34  // the private implementation of the class
35  struct qore_sslpk_private *priv;
36 
38  DLLLOCAL QoreSSLPrivateKey(const QoreSSLPrivateKey&);
39 
41  DLLLOCAL QoreSSLPrivateKey& operator=(const QoreSSLPrivateKey&);
42 
43 protected:
44  DLLLOCAL virtual ~QoreSSLPrivateKey();
45 
46 public:
48 
52  DLLEXPORT QoreSSLPrivateKey(const char *fn, const char *pp, ExceptionSink *xsink);
53 
55 
58  DLLEXPORT QoreSSLPrivateKey(const BinaryNode *bin, ExceptionSink *xsink);
59 
61 
65  DLLEXPORT QoreSSLPrivateKey(const QoreString *str, const char *pp, ExceptionSink *xsink);
66 
68 
70  DLLEXPORT QoreStringNode *getPEM(ExceptionSink *xsink) const;
71 
72  // caller does NOT own the EVP_PKEY returned; "const" cannot be used because of the openssl API does not support it
73  DLLEXPORT EVP_PKEY *getData() const;
74 
75  DLLEXPORT const char *getType() const;
76 
78  DLLEXPORT int64 getVersion() const;
79 
81  DLLEXPORT int64 getBitLength() const;
82 
84  DLLEXPORT QoreHashNode *getInfo() const;
85 
87  DLLLOCAL QoreSSLPrivateKey(EVP_PKEY *p);
88 };
89 
90 #endif
DLLEXPORT int64 getVersion() const
returns a constant '1': do not use; only included for backwards-compatibility
This is the hash or associative list container type in Qore, dynamically allocated only...
Definition: QoreHashNode.h:41
the base class for all data to be used as private data of Qore objects
Definition: AbstractPrivateData.h:36
DLLEXPORT int64 getBitLength() const
returns the length in bits
provides access to a private key data structure for SSL connections
Definition: QoreSSLPrivateKey.h:32
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:42
Qore's string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:40
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:35
DLLEXPORT QoreStringNode * getPEM(ExceptionSink *xsink) const
returns a string in PEM format representing the private key, caller owns the QoreString reference cou...
DLLEXPORT QoreHashNode * getInfo() const
caller owns the QoreHashNode reference count returned
holds arbitrary binary data
Definition: BinaryNode.h:33