00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _QORE_QORESSLCERTIFICATE_H
00024
00025 #define _QORE_QORESSLCERTIFICATE_H
00026
00027 #include <qore/QoreSSLBase.h>
00028
00029 #include <openssl/ssl.h>
00030 #include <openssl/pem.h>
00031
00033 class QoreSSLCertificate : public AbstractPrivateData, public QoreSSLBase
00034 {
00035 private:
00037 struct qore_sslcert_private *priv;
00038
00039 DLLLOCAL AbstractQoreNode *doPurposeValue(int id, int ca) const;
00040
00042 DLLLOCAL QoreSSLCertificate(const QoreSSLCertificate&);
00043
00045 DLLLOCAL QoreSSLCertificate& operator=(const QoreSSLCertificate&);
00046
00047 protected:
00049 DLLLOCAL virtual ~QoreSSLCertificate();
00050
00051 public:
00053
00055 DLLEXPORT QoreSSLCertificate(X509 *c);
00056
00058
00061 DLLEXPORT QoreSSLCertificate(const BinaryNode *bin, ExceptionSink *xsink);
00062
00064
00067 DLLEXPORT QoreSSLCertificate(const QoreString *str, ExceptionSink *xsink);
00068
00070
00073 DLLLOCAL QoreSSLCertificate(const char *fn, ExceptionSink *xsink);
00074
00076 DLLEXPORT operator bool() const;
00077
00079
00081 DLLEXPORT QoreStringNode *getPEM(ExceptionSink *xsink) const;
00082
00083
00084 DLLEXPORT X509 *getData() const;
00085
00086
00087 DLLEXPORT QoreHashNode *getSubjectHash() const;
00088
00089
00090 DLLEXPORT QoreHashNode *getIssuerHash() const;
00091 DLLEXPORT int64 getSerialNumber() const;
00092 DLLEXPORT int64 getVersion() const;
00093
00094
00095 DLLEXPORT QoreHashNode *getPurposeHash() const;
00096
00097
00098 DLLEXPORT DateTimeNode *getNotBeforeDate() const;
00099
00100
00101 DLLEXPORT DateTimeNode *getNotAfterDate() const;
00102
00103
00104 DLLEXPORT QoreStringNode *getSignatureType() const;
00105
00106
00107 DLLEXPORT BinaryNode *getSignature() const;
00108
00109
00110 DLLEXPORT QoreStringNode *getPublicKeyAlgorithm() const;
00111
00112
00113 DLLEXPORT BinaryNode *getPublicKey() const;
00114
00115
00116 DLLEXPORT QoreHashNode *getInfo() const;
00117 };
00118
00119 #endif