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

Function NewCertFromExisting

test/base-tlsutility.cpp:85–89  ·  view source on GitHub ↗

* Creates a new certificate based on an existing one, with modified validity period. * * @param cert The existing certificate to base the new one on. * @param validFrom The start time of the new certificate's validity period (in seconds). * @param validFor The duration of the new certificate's validity period (in seconds). * @param caCert Whether the new certificate should be a CA certificate

Source from the content-addressed store, hash-verified

83 * @returns A shared pointer to the newly created X509 certificate.
84 */
85static auto NewCertFromExisting(const std::shared_ptr<X509>& cert, long validFrom, long validFor, bool caCert = false)
86{
87 std::shared_ptr<EVP_PKEY> caPubKey(X509_get_pubkey(cert.get()), EVP_PKEY_free);
88 return CreateCertIcingaCA(caPubKey.get(), X509_get_subject_name(cert.get()), validFrom, validFor, caCert);
89}
90
91/**
92 * Creates an ASN1_TIME object representing the current time plus the specified number of seconds.

Callers 1

Calls 2

CreateCertIcingaCAFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected