diff --git a/src/security/cert/gnutls/X509Certificate_GnuTLS.cpp b/src/security/cert/gnutls/X509Certificate_GnuTLS.cpp index 1401c991..fd1343dd 100644 --- a/src/security/cert/gnutls/X509Certificate_GnuTLS.cpp +++ b/src/security/cert/gnutls/X509Certificate_GnuTLS.cpp @@ -82,6 +82,12 @@ X509Certificate_GnuTLS::~X509Certificate_GnuTLS() } +void* X509Certificate_GnuTLS::getInternalData() +{ + return &m_data->cert; +} + + // static ref X509Certificate::import(utility::inputStream& is) { diff --git a/src/security/cert/openssl/X509Certificate_OpenSSL.cpp b/src/security/cert/openssl/X509Certificate_OpenSSL.cpp index 08381ae1..ff2062c1 100755 --- a/src/security/cert/openssl/X509Certificate_OpenSSL.cpp +++ b/src/security/cert/openssl/X509Certificate_OpenSSL.cpp @@ -151,6 +151,12 @@ X509Certificate_OpenSSL::~X509Certificate_OpenSSL() } +void* X509Certificate_OpenSSL::getInternalData() +{ + return &m_data->cert; +} + + // static ref X509Certificate_OpenSSL::importInternal(X509* cert) { diff --git a/vmime/security/cert/certificate.hpp b/vmime/security/cert/certificate.hpp index 1dc45035..05f10727 100644 --- a/vmime/security/cert/certificate.hpp +++ b/vmime/security/cert/certificate.hpp @@ -65,6 +65,13 @@ public: * false otherwise */ virtual bool equals(ref other) const = 0; + + /** Returns a pointer to internal binary data for this certificate. + * The actual type of data depends on the library used for TLS support. + * + * @return pointer to underlying data + */ + virtual void* getInternalData() = 0; }; diff --git a/vmime/security/cert/gnutls/X509Certificate_GnuTLS.hpp b/vmime/security/cert/gnutls/X509Certificate_GnuTLS.hpp index 241ef46c..bd38342d 100644 --- a/vmime/security/cert/gnutls/X509Certificate_GnuTLS.hpp +++ b/vmime/security/cert/gnutls/X509Certificate_GnuTLS.hpp @@ -75,6 +75,7 @@ public: const string getType() const; int getVersion() const; bool equals(ref other) const; + void* getInternalData(); private: diff --git a/vmime/security/cert/openssl/X509Certificate_OpenSSL.hpp b/vmime/security/cert/openssl/X509Certificate_OpenSSL.hpp index 6855bd07..de8ad949 100644 --- a/vmime/security/cert/openssl/X509Certificate_OpenSSL.hpp +++ b/vmime/security/cert/openssl/X509Certificate_OpenSSL.hpp @@ -81,6 +81,7 @@ public: const string getType() const; int getVersion() const; bool equals(ref other) const; + void* getInternalData(); private: