mirror of https://github.com/Icinga/icinga2.git
CertificateToString(): allow raw pointer input
This commit is contained in:
parent
bc778116e9
commit
551c3afa60
|
@ -787,10 +787,10 @@ bool IsCaUptodate(X509* cert)
|
|||
return !CertExpiresWithin(cert, LEAF_VALID_FOR);
|
||||
}
|
||||
|
||||
String CertificateToString(const std::shared_ptr<X509>& cert)
|
||||
String CertificateToString(X509* cert)
|
||||
{
|
||||
BIO *mem = BIO_new(BIO_s_mem());
|
||||
PEM_write_bio_X509(mem, cert.get());
|
||||
PEM_write_bio_X509(mem, cert);
|
||||
|
||||
char *data;
|
||||
long len = BIO_get_mem_data(mem, &data);
|
||||
|
|
|
@ -58,7 +58,12 @@ int MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile =
|
|||
std::shared_ptr<X509> CreateCert(EVP_PKEY *pubkey, X509_NAME *subject, X509_NAME *issuer, EVP_PKEY *cakey, bool ca);
|
||||
|
||||
String GetIcingaCADir();
|
||||
String CertificateToString(const std::shared_ptr<X509>& cert);
|
||||
String CertificateToString(X509* cert);
|
||||
|
||||
inline String CertificateToString(const std::shared_ptr<X509>& cert)
|
||||
{
|
||||
return CertificateToString(cert.get());
|
||||
}
|
||||
|
||||
std::shared_ptr<X509> StringToCertificate(const String& cert);
|
||||
std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject, bool ca = false);
|
||||
|
|
Loading…
Reference in New Issue