CertInfo: add is_expired_after_epoch
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
0796b642de
commit
134ed9e14f
@ -96,4 +96,9 @@ impl CertInfo {
|
||||
pub fn not_after_unix(&self) -> Result<i64, Error> {
|
||||
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<bool, Error> {
|
||||
Ok(self.not_after_unix()? < epoch)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user