MCPcopy Create free account
hub / github.com/Icinga/icinga2 / StringToCertificate

Function StringToCertificate

lib/base/tlsutility.cpp:893–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

891}
892
893std::shared_ptr<X509> StringToCertificate(const String& cert)
894{
895 BIO *bio = BIO_new(BIO_s_mem());
896 BIO_write(bio, (const void *)cert.CStr(), cert.GetLength());
897
898 X509 *rawCert = PEM_read_bio_X509_AUX(bio, nullptr, nullptr, nullptr);
899
900 BIO_free(bio);
901
902 if (!rawCert)
903 BOOST_THROW_EXCEPTION(std::invalid_argument("The specified X509 certificate is invalid."));
904
905 return std::shared_ptr<X509>(rawCert, X509_free);
906}
907
908String PBKDF2_SHA1(const String& password, const String& salt, int iterations)
909{

Callers 10

RequestCertificateMethod · 0.85
CollectRequestHandlerFunction · 0.85
UpdateCertificateHandlerFunction · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
VerifyCertificateFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 2

CStrMethod · 0.80
GetLengthMethod · 0.45

Tested by

no test coverage detected