QoreSSLPrivateKey.h
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
QC_SSLPrivateKey.h
Qore Programming Language
Copyright (C) 2003 - 2015 David Nichols
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Note that the Qore library is released under a choice of three open-source
licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
information.
*/
#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;
DLLEXPORT QoreSSLPrivateKey* pkRefSelf() const;
DLLLOCAL QoreSSLPrivateKey(EVP_PKEY* p);
};
#endif
QoreSSLPrivateKey::getVersion
DLLEXPORT int64 getVersion() const
returns a constant '1': do not use; only included for backwards-compatibility
QoreHashNode
This is the hash or associative list container type in Qore, dynamically allocated only...
Definition: QoreHashNode.h:49
AbstractPrivateData
the base class for all data to be used as private data of Qore objects
Definition: AbstractPrivateData.h:44
QoreSSLPrivateKey::getBitLength
DLLEXPORT int64 getBitLength() const
returns the length in bits
QoreSSLPrivateKey
provides access to a private key data structure for SSL connections
Definition: QoreSSLPrivateKey.h:40
QoreString
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:82
QoreStringNode
Qore's string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:50
QoreSSLPrivateKey::pkRefSelf
DLLEXPORT QoreSSLPrivateKey * pkRefSelf() const
caller owns reference returned
ExceptionSink
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:43
int64
long long int64
64bit integer type, cannot use int64_t here since it breaks the API on some 64-bit systems due to equ...
Definition: common.h:228
QoreSSLPrivateKey::getPEM
DLLEXPORT QoreStringNode * getPEM(ExceptionSink *xsink) const
returns a string in PEM format representing the private key, caller owns the QoreString reference cou...
QoreSSLPrivateKey::getInfo
DLLEXPORT QoreHashNode * getInfo() const
caller owns the QoreHashNode reference count returned
BinaryNode
holds arbitrary binary data
Definition: BinaryNode.h:41