[pbs-devel] applied: [PATCH v2 backup 06/27] CertInfo: add is_expired_after_epoch

Dietmar Maurer dietmar at proxmox.com
Thu Apr 29 11:11:44 CEST 2021


applied

On 4/22/21 4:01 PM, Wolfgang Bumiller wrote:
> Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
> ---
>   src/tools/cert.rs | 5 +++++
>   1 file changed, 5 insertions(+)
>
> 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<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)
> +    }
>   }





More information about the pbs-devel mailing list