Qore Programming Language  0.8.7
 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