summaryrefslogtreecommitdiff
path: root/src/certificates.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/certificates.cc')
-rw-r--r--src/certificates.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/certificates.cc b/src/certificates.cc
index 1c0ef984..cc443746 100644
--- a/src/certificates.cc
+++ b/src/certificates.cc
@@ -46,7 +46,7 @@ Certificate::Certificate (X509* c)
: _certificate (c)
, _public_key (0)
{
-
+
}
/** Load an X509 certificate from a string.
@@ -109,7 +109,7 @@ Certificate::operator= (Certificate const & other)
_certificate = 0;
RSA_free (_public_key);
_public_key = 0;
-
+
read_string (other.certificate (true));
return *this;
@@ -123,12 +123,12 @@ string
Certificate::certificate (bool with_begin_end) const
{
DCP_ASSERT (_certificate);
-
+
BIO* bio = BIO_new (BIO_s_mem ());
if (!bio) {
throw MiscError ("could not create memory BIO");
}
-
+
PEM_write_bio_X509 (bio, _certificate);
string s;
@@ -144,7 +144,7 @@ Certificate::certificate (bool with_begin_end) const
boost::replace_all (s, "-----BEGIN CERTIFICATE-----\n", "");
boost::replace_all (s, "\n-----END CERTIFICATE-----\n", "");
}
-
+
return s;
}
@@ -177,7 +177,7 @@ Certificate::get_name_part (X509_NAME* n, int nid)
DCP_ASSERT (p != -1);
return asn_to_utf8 (X509_NAME_ENTRY_get_data (X509_NAME_get_entry (n, p)));
}
-
+
string
Certificate::name_for_xml (X509_NAME* name)
{
@@ -225,11 +225,11 @@ Certificate::serial () const
ASN1_INTEGER* s = X509_get_serialNumber (_certificate);
DCP_ASSERT (s);
-
+
BIGNUM* b = ASN1_INTEGER_to_BN (s, 0);
char* c = BN_bn2dec (b);
BN_free (b);
-
+
string st (c);
OPENSSL_free (c);
@@ -240,7 +240,7 @@ string
Certificate::thumbprint () const
{
DCP_ASSERT (_certificate);
-
+
uint8_t buffer[8192];
uint8_t* p = buffer;
i2d_X509_CINF (_certificate->cert_info, &p);