Qore Programming Language  0.8.3
include/qore/QoreSSLPrivateKey.h (4311)
00001 /* -*- mode: c++; indent-tabs-mode: nil -*- */
00002 /*
00003   QC_SSLPrivateKey.h
00004   
00005   Qore Programming Language
00006 
00007   Copyright 2003 - 2011 David Nichols
00008 
00009   This library is free software; you can redistribute it and/or
00010   modify it under the terms of the GNU Lesser General Public
00011   License as published by the Free Software Foundation; either
00012   version 2.1 of the License, or (at your option) any later version.
00013 
00014   This library is distributed in the hope that it will be useful,
00015   but WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017   Lesser General Public License for more details.
00018 
00019   You should have received a copy of the GNU Lesser General Public
00020   License along with this library; if not, write to the Free Software
00021   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00022  */
00023 
00024 #ifndef _QORE_QORESSLPRIVATEKEY_H
00025 
00026 #define _QORE_QORESSLPRIVATEKEY_H
00027 
00028 #include <openssl/ssl.h>
00029 #include <openssl/evp.h>
00030 
00032 class QoreSSLPrivateKey : public AbstractPrivateData {
00033 private:
00034    // the private implementation of the class
00035    struct qore_sslpk_private *priv; 
00036 
00038    DLLLOCAL QoreSSLPrivateKey(const QoreSSLPrivateKey&);
00039 
00041    DLLLOCAL QoreSSLPrivateKey& operator=(const QoreSSLPrivateKey&);
00042 
00043 protected:
00044    DLLLOCAL virtual ~QoreSSLPrivateKey();
00045 
00046 public:
00048 
00052    DLLEXPORT QoreSSLPrivateKey(const char *fn, const char *pp, ExceptionSink *xsink);
00053 
00055 
00058    DLLEXPORT QoreSSLPrivateKey(const BinaryNode *bin, ExceptionSink *xsink);
00059 
00061 
00065    DLLEXPORT QoreSSLPrivateKey(const QoreString *str, const char *pp, ExceptionSink *xsink);
00066 
00068 
00070    DLLEXPORT QoreStringNode *getPEM(ExceptionSink *xsink) const;
00071 
00072    // caller does NOT own the EVP_PKEY returned; "const" cannot be used because of the openssl API does not support it
00073    DLLEXPORT EVP_PKEY *getData() const;
00074 
00075    DLLEXPORT const char *getType() const;
00076 
00078    DLLEXPORT int64 getVersion() const;
00079 
00081    DLLEXPORT int64 getBitLength() const;
00082 
00084    DLLEXPORT QoreHashNode *getInfo() const;
00085 
00087    DLLLOCAL QoreSSLPrivateKey(EVP_PKEY *p);
00088 };
00089 
00090 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines