diff --git a/src/tools/cert.rs b/src/tools/cert.rs index d3c221a4..bcc3e69b 100644 --- a/src/tools/cert.rs +++ b/src/tools/cert.rs @@ -96,4 +96,9 @@ impl CertInfo { pub fn not_after_unix(&self) -> Result { asn1_time_to_unix(&self.not_after()) } + + /// Check if the certificate is expired at or after a specific unix epoch. + pub fn is_expired_after_epoch(&self, epoch: i64) -> Result { + Ok(self.not_after_unix()? < epoch) + } }