* 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
| 83 | * @returns A shared pointer to the newly created X509 certificate. |
| 84 | */ |
| 85 | static 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. |
no test coverage detected