All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreSSLPrivateKey.h
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
QC_SSLPrivateKey.h
Qore Programming Language
Copyright 2003 - 2013 David Nichols
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _QORE_QORESSLPRIVATEKEY_H
#define _QORE_QORESSLPRIVATEKEY_H
#include <openssl/ssl.h>
#include <openssl/evp.h>
class QoreSSLPrivateKey : public AbstractPrivateData {
private:
// the private implementation of the class
struct qore_sslpk_private *priv;
DLLLOCAL QoreSSLPrivateKey(const QoreSSLPrivateKey&);
DLLLOCAL QoreSSLPrivateKey& operator=(const QoreSSLPrivateKey&);
protected:
DLLLOCAL virtual ~QoreSSLPrivateKey();
public:
DLLEXPORT QoreSSLPrivateKey(const char *fn, const char *pp, ExceptionSink *xsink);
DLLEXPORT QoreSSLPrivateKey(const BinaryNode *bin, ExceptionSink *xsink);
DLLEXPORT QoreSSLPrivateKey(const QoreString *str, const char *pp, ExceptionSink *xsink);
DLLEXPORT QoreStringNode *getPEM(ExceptionSink *xsink) const;
// caller does NOT own the EVP_PKEY returned; "const" cannot be used because of the openssl API does not support it
DLLEXPORT EVP_PKEY *getData() const;
DLLEXPORT const char *getType() const;
DLLEXPORT int64 getVersion() const;
DLLEXPORT int64 getBitLength() const;
DLLEXPORT QoreHashNode *getInfo() const;
DLLLOCAL QoreSSLPrivateKey(EVP_PKEY *p);
};
#endif