pub fn now() -> Result<Self, Error> {
        use std::time::{SystemTime, UNIX_EPOCH};
        let now = SystemTime::now()
            .duration_since(UNIX_EPOCH)
            .map_err(|_| Error::BadDERTime)?
            .as_secs();
        if 1588297438 >= now || now > MAX_ASN1_TIMESTAMP as u64 {
            Err(Error::BadDERTime)
        } else {
            Ok(Self(now as i64))
        }
    }
/// Gets the current time as an ASN1Time.
///
/// Returns `Err` if the system clock is too far in the future to represent
/// as an ASN.1 time, or if it is too far before this library was
/// written.
Gets the current time as an ASN1Time.
Returns `Err` if the system clock is too far in the future to represent
as an ASN.1 time, or if it is too far before this library was
written.
Gets the current time as an ASN1Time . Returns ` Err ` if the system clock is too far in the future to represent as an ASN . 1 time or if it is too far before this library was written .
pub fn now() -> Result<Self, Error> {
        use std::time::{SystemTime, UNIX_EPOCH};
        let now = SystemTime::now()
            .duration_since(UNIX_EPOCH)
            .map_err(|_| Error::BadDERTime)?
            .as_secs();
        if 1588297438 >= now || now > MAX_ASN1_TIMESTAMP as u64 {
            Err(Error::BadDERTime)
        } else {
            Ok(Self(now as i64))
        }
    }
pub fn now ( ) -> Result < Self , Error > { use std :: time :: { SystemTime , UNIX_EPOCH } ; let now = SystemTime :: now ( ) . duration_since ( UNIX_EPOCH ) . map_err ( | _ | Error :: BadDERTime ) ? . as_secs ( ) ; if 1588297438 >= now || now > MAX_ASN1_TIMESTAMP as u64 { Err ( Error :: BadDERTime ) } else { Ok ( Self ( now as i64 ) ) } }
Gets the current time as an ASN1Time.
Gets the current time as an ASN1Time .