#191 X509Certificate::import() now auto-detects format
This commit is contained in:
parent
abba40e97d
commit
f04190bafa
@ -931,17 +931,7 @@ vmime::shared_ptr <vmime::security::cert::X509Certificate>
|
|||||||
vmime::utility::inputStreamAdapter is(certFile);
|
vmime::utility::inputStreamAdapter is(certFile);
|
||||||
vmime::shared_ptr <vmime::security::cert::X509Certificate> cert;
|
vmime::shared_ptr <vmime::security::cert::X509Certificate> cert;
|
||||||
|
|
||||||
// Try DER format
|
cert = vmime::security::cert::X509Certificate::import(is);
|
||||||
cert = vmime::security::cert::X509Certificate::import
|
|
||||||
(is, vmime::security::cert::X509Certificate::FORMAT_DER);
|
|
||||||
|
|
||||||
if (cert != NULL)
|
|
||||||
return cert;
|
|
||||||
|
|
||||||
// Try PEM format
|
|
||||||
is.reset();
|
|
||||||
cert = vmime::security::cert::X509Certificate::import
|
|
||||||
(is, vmime::security::cert::X509Certificate::FORMAT_PEM);
|
|
||||||
|
|
||||||
return cert;
|
return cert;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user