pub struct CertValidity {
pub not_before: UtcTime,
pub not_after: UtcTime,
}Expand description
A struct to hold the validity period of a certificate
Fields§
§not_before: UtcTimeThe not before date of the certificate
not_after: UtcTimeThe not after date of the certificate
Implementations§
Source§impl CertValidity
impl CertValidity
Sourcepub fn new(
not_before: Option<&str>,
not_after: &str,
) -> Result<CertValidity, QuantCryptError>
pub fn new( not_before: Option<&str>, not_after: &str, ) -> Result<CertValidity, QuantCryptError>
Create a new CertValidity struct
§Arguments
not_before- The not before date of the certificate. If None, the current time is used. The date should be in RFC3339 format.not_after- The not after date of the certificate. The date should be in RFC3339 format.
§Returns
A new CertValidity struct
§Errors
QuantCryptError::InvalidNotBefore if the not before date is in the future
QuantCryptError::InvalidNotAfter if the not after date is in the past
Trait Implementations§
Source§impl Clone for CertValidity
impl Clone for CertValidity
Source§fn clone(&self) -> CertValidity
fn clone(&self) -> CertValidity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CertValidity
impl RefUnwindSafe for CertValidity
impl Send for CertValidity
impl Sync for CertValidity
impl Unpin for CertValidity
impl UnwindSafe for CertValidity
Blanket Implementations§
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