All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreSSLCertificate.h
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
QoreSSLCertificate.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_QORESSLCERTIFICATE_H
#define _QORE_QORESSLCERTIFICATE_H
#include <qore/QoreSSLBase.h>
#include <openssl/ssl.h>
#include <openssl/pem.h>
class QoreSSLCertificate : public AbstractPrivateData, public QoreSSLBase {
private:
struct qore_sslcert_private *priv;
DLLLOCAL AbstractQoreNode *doPurposeValue(int id, int ca) const;
DLLLOCAL QoreSSLCertificate(const QoreSSLCertificate&);
DLLLOCAL QoreSSLCertificate& operator=(const QoreSSLCertificate&);
protected:
DLLLOCAL virtual ~QoreSSLCertificate();
public:
DLLEXPORT QoreSSLCertificate(X509 *c);
DLLEXPORT QoreSSLCertificate(const BinaryNode *bin, ExceptionSink *xsink);
DLLEXPORT QoreSSLCertificate(const QoreString *str, ExceptionSink *xsink);
DLLLOCAL QoreSSLCertificate(const char *fn, ExceptionSink *xsink);
DLLEXPORT operator bool() const;
DLLEXPORT QoreStringNode *getPEM(ExceptionSink *xsink) const;
// caller does NOT own the X509 pointer returned; "const" cannot be used because of the openssl API does not support it
DLLEXPORT X509 *getData() const;
// caller owns value returned
DLLEXPORT QoreHashNode *getSubjectHash() const;
// caller owns value returned
DLLEXPORT QoreHashNode *getIssuerHash() const;
DLLEXPORT int64 getSerialNumber() const;
DLLEXPORT int64 getVersion() const;
// caller owns value returned
DLLEXPORT QoreHashNode *getPurposeHash() const;
// caller owns value returned
DLLEXPORT DateTimeNode *getNotBeforeDate() const;
// caller owns value returned
DLLEXPORT DateTimeNode *getNotAfterDate() const;
// caller owns value returned
DLLEXPORT QoreStringNode *getSignatureType() const;
// caller owns value returned
DLLEXPORT BinaryNode *getSignature() const;
// caller owns value returned
DLLEXPORT QoreStringNode *getPublicKeyAlgorithm() const;
// caller owns value returned
DLLEXPORT BinaryNode *getPublicKey() const;
// caller owns value returned
DLLEXPORT QoreHashNode *getInfo() const;
};
#endif