aboutsummaryrefslogtreecommitdiffstats
path: root/src/security/cert/openssl/X509Certificate_OpenSSL.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-11-21 21:16:57 +0000
committerVincent Richard <[email protected]>2013-11-21 21:16:57 +0000
commitf9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8 (patch)
tree2bdc90e361a8f6e0a81164cf67afec9f78f9b959 /src/security/cert/openssl/X509Certificate_OpenSSL.cpp
parentPer-protocol include files. (diff)
downloadvmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.tar.gz
vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.zip
Boost/C++11 shared pointers.
Diffstat (limited to 'src/security/cert/openssl/X509Certificate_OpenSSL.cpp')
-rw-r--r--src/security/cert/openssl/X509Certificate_OpenSSL.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/security/cert/openssl/X509Certificate_OpenSSL.cpp b/src/security/cert/openssl/X509Certificate_OpenSSL.cpp
index 8c18583b..8c7174a0 100644
--- a/src/security/cert/openssl/X509Certificate_OpenSSL.cpp
+++ b/src/security/cert/openssl/X509Certificate_OpenSSL.cpp
@@ -158,17 +158,17 @@ void* X509Certificate_OpenSSL::getInternalData()
// static
-ref <X509Certificate> X509Certificate_OpenSSL::importInternal(X509* cert)
+shared_ptr <X509Certificate> X509Certificate_OpenSSL::importInternal(X509* cert)
{
if (cert)
- return vmime::create <X509Certificate_OpenSSL>(reinterpret_cast <X509 *>(cert));
+ return make_shared <X509Certificate_OpenSSL>(reinterpret_cast <X509 *>(cert));
- return NULL;
+ return null;
}
// static
-ref <X509Certificate> X509Certificate::import(utility::inputStream& is)
+shared_ptr <X509Certificate> X509Certificate::import(utility::inputStream& is)
{
byteArray bytes;
utility::stream::value_type chunk[4096];
@@ -184,17 +184,17 @@ ref <X509Certificate> X509Certificate::import(utility::inputStream& is)
// static
-ref <X509Certificate> X509Certificate::import
+shared_ptr <X509Certificate> X509Certificate::import
(const byte_t* data, const size_t length)
{
- ref <X509Certificate_OpenSSL> cert = vmime::create <X509Certificate_OpenSSL>();
+ shared_ptr <X509Certificate_OpenSSL> cert = make_shared <X509Certificate_OpenSSL>();
BIO* membio = BIO_new_mem_buf(const_cast <byte_t*>(data), length);
if (!PEM_read_bio_X509(membio, &(cert->m_data->cert), 0, 0))
{
BIO_vfree(membio);
- return NULL;
+ return null;
}
BIO_vfree(membio);
@@ -270,10 +270,10 @@ const byteArray X509Certificate_OpenSSL::getSerialNumber() const
}
-bool X509Certificate_OpenSSL::checkIssuer(ref <const X509Certificate> cert_) const
+bool X509Certificate_OpenSSL::checkIssuer(shared_ptr <const X509Certificate> cert_) const
{
- ref <const X509Certificate_OpenSSL> cert =
- cert_.dynamicCast <const X509Certificate_OpenSSL>();
+ shared_ptr <const X509Certificate_OpenSSL> cert =
+ dynamicCast <const X509Certificate_OpenSSL>(cert_);
// Get issuer for this cert
BIO *out;
@@ -297,10 +297,10 @@ bool X509Certificate_OpenSSL::checkIssuer(ref <const X509Certificate> cert_) con
}
-bool X509Certificate_OpenSSL::verify(ref <const X509Certificate> caCert_) const
+bool X509Certificate_OpenSSL::verify(shared_ptr <const X509Certificate> caCert_) const
{
- ref <const X509Certificate_OpenSSL> caCert =
- caCert_.dynamicCast <const X509Certificate_OpenSSL>();
+ shared_ptr <const X509Certificate_OpenSSL> caCert =
+ dynamicCast <const X509Certificate_OpenSSL>(caCert_);
bool verified = false;
@@ -550,10 +550,10 @@ int X509Certificate_OpenSSL::getVersion() const
}
-bool X509Certificate_OpenSSL::equals(ref <const certificate> other) const
+bool X509Certificate_OpenSSL::equals(shared_ptr <const certificate> other) const
{
- ref <const X509Certificate_OpenSSL> otherX509 =
- other.dynamicCast <const X509Certificate_OpenSSL>();
+ shared_ptr <const X509Certificate_OpenSSL> otherX509 =
+ dynamicCast <const X509Certificate_OpenSSL>(other);
if (!otherX509)
return false;