pub struct Validity { /* private fields */ }Expand description
The Validity is the time interval during which a Certificate is
considered valid.
An X.509 certificate validity period is defined in RFC 5280 § 4.1.2.5 as
a SEQUENCE of two date-time values: notBefore and notAfter. The
certificate is considered valid only during the closed interval
[notBefore, notAfter].
Implementations§
Source§impl Validity
impl Validity
Sourcepub fn not_before_as_timestamp(&self) -> Timestamp
pub fn not_before_as_timestamp(&self) -> Timestamp
Return the Timestamp at which the certificate becomes valid.
Sourcepub fn not_after_as_timestamp(&self) -> Timestamp
pub fn not_after_as_timestamp(&self) -> Timestamp
Return the Timestamp at which the certificate expires.
Sourcepub fn as_display_str(&self) -> &str
pub fn as_display_str(&self) -> &str
Render notBefore and notAfter of Timestamp as a single string
Example 2024-01-01T00:00:00Z..2025-01-01T00:00:00Z
This value is lazily rendered and cached for reuse.
Sourcepub fn range(&self) -> RangeInclusive<Timestamp>
pub fn range(&self) -> RangeInclusive<Timestamp>
Return the validity as a RangeInclusive.
From [RFC 5280 § 4.1.2.5]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.5 the validity period for a certificate is the period of time from notBefore through notAfter, inclusive