* Checks whether the specified certificate expires within the specified number of seconds. * * @param cert The certificate to its expiration for. * @param seconds The number of seconds to check against. * * @returns True if the certificate expires within the specified number of seconds, false otherwise. */
| 809 | * @returns True if the certificate expires within the specified number of seconds, false otherwise. |
| 810 | */ |
| 811 | static bool CertExpiresWithin(X509* cert, long seconds) |
| 812 | { |
| 813 | auto now = time(nullptr); |
| 814 | std::shared_ptr<ASN1_TIME> renewalStart(X509_time_adj_ex(nullptr, 0, seconds, &now), ASN1_TIME_free); |
| 815 | |
| 816 | return Asn1TimeCompare(X509_get_notAfter(cert), renewalStart.get()) < 0; |
| 817 | } |
| 818 | |
| 819 | bool IsCertUptodate(const std::shared_ptr<X509>& cert) |
| 820 | { |
no test coverage detected