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