Struct x509_parser::certificate::Validity
source · pub struct Validity {
pub not_before: ASN1Time,
pub not_after: ASN1Time,
}
Fields§
§not_before: ASN1Time
§not_after: ASN1Time
Implementations§
source§impl Validity
impl Validity
sourcepub fn time_to_expiration(&self) -> Option<Duration>
pub fn time_to_expiration(&self) -> Option<Duration>
The time left before the certificate expires.
If the certificate is not currently valid, then None
is
returned. Otherwise, the Duration
until the certificate
expires is returned.
sourcepub fn is_valid_at(&self, time: ASN1Time) -> bool
pub fn is_valid_at(&self, time: ASN1Time) -> bool
Check the certificate time validity for the provided date/time
Trait Implementations§
source§impl<'a> FromDer<'a, X509Error> for Validity
impl<'a> FromDer<'a, X509Error> for Validity
source§fn from_der(i: &[u8]) -> X509Result<'_, Self>
fn from_der(i: &[u8]) -> X509Result<'_, Self>
Attempt to parse input bytes into a DER object (enforcing constraints)
impl Eq for Validity
impl StructuralPartialEq for Validity
Auto Trait Implementations§
impl Freeze for Validity
impl RefUnwindSafe for Validity
impl Send for Validity
impl Sync for Validity
impl Unpin for Validity
impl UnwindSafe for Validity
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)