Struct openssl::asn1::Asn1Time [−][src]
pub struct Asn1Time(_);
Time storage and comparison
Asn1Time should be used to store and share time information using certificates. If Asn1Time is set using a string, it must be in either YYMMDDHHMMSSZ, YYYYMMDDHHMMSSZ, or another ASN.1 format.
ASN_TIME_set documentation at OpenSSL explains the ASN.1 implementation used by OpenSSL.
Implementations
impl Asn1Time
[src]
impl Asn1Time
[src]pub fn days_from_now(days: u32) -> Result<Asn1Time, ErrorStack>
[src]
Creates a new time on specified interval in days from now
pub fn from_unix(time: time_t) -> Result<Asn1Time, ErrorStack>
[src]
Creates a new time from the specified time_t
value
pub fn from_str(s: &str) -> Result<Asn1Time, ErrorStack>
[src]
Creates a new time corresponding to the specified ASN1 time string.
This corresponds to ASN1_TIME_set_string
.
pub fn from_str_x509(s: &str) -> Result<Asn1Time, ErrorStack>
[src]
Creates a new time corresponding to the specified X509 time string.
This corresponds to ASN1_TIME_set_string_X509
.
Requires OpenSSL 1.1.1 or newer.
Methods from Deref<Target = Asn1TimeRef>
pub fn diff(&self, compare: &Self) -> Result<TimeDiff, ErrorStack>
[src]
Find difference between two times
This corresponds to ASN1_TIME_diff
.
pub fn compare(&self, other: &Self) -> Result<Ordering, ErrorStack>
[src]
Compare two times
This corresponds to ASN1_TIME_compare
but is implemented using diff
so that it is
also supported on older versions of OpenSSL.
Trait Implementations
impl AsRef<Asn1TimeRef> for Asn1Time
[src]
impl AsRef<Asn1TimeRef> for Asn1Time
[src]fn as_ref(&self) -> &Asn1TimeRef
[src]
impl Borrow<Asn1TimeRef> for Asn1Time
[src]
impl Borrow<Asn1TimeRef> for Asn1Time
[src]fn borrow(&self) -> &Asn1TimeRef
[src]
impl Deref for Asn1Time
[src]
impl Deref for Asn1Time
[src]type Target = Asn1TimeRef
The resulting type after dereferencing.
fn deref(&self) -> &Asn1TimeRef
[src]
impl ForeignType for Asn1Time
[src]
impl ForeignType for Asn1Time
[src]impl<'a> PartialEq<&'a Asn1TimeRef> for Asn1Time
[src]
impl<'a> PartialEq<&'a Asn1TimeRef> for Asn1Time
[src]impl PartialEq<Asn1Time> for Asn1TimeRef
[src]
impl PartialEq<Asn1Time> for Asn1TimeRef
[src]impl<'a> PartialEq<Asn1Time> for &'a Asn1TimeRef
[src]
impl<'a> PartialEq<Asn1Time> for &'a Asn1TimeRef
[src]impl PartialEq<Asn1TimeRef> for Asn1Time
[src]
impl PartialEq<Asn1TimeRef> for Asn1Time
[src]impl<'a> PartialOrd<&'a Asn1TimeRef> for Asn1Time
[src]
impl<'a> PartialOrd<&'a Asn1TimeRef> for Asn1Time
[src]fn partial_cmp(&self, other: &&'a Asn1TimeRef) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Asn1Time> for Asn1TimeRef
[src]
impl PartialOrd<Asn1Time> for Asn1TimeRef
[src]impl<'a> PartialOrd<Asn1Time> for &'a Asn1TimeRef
[src]
impl<'a> PartialOrd<Asn1Time> for &'a Asn1TimeRef
[src]impl PartialOrd<Asn1Time> for Asn1Time
[src]
impl PartialOrd<Asn1Time> for Asn1Time
[src]impl PartialOrd<Asn1TimeRef> for Asn1Time
[src]
impl PartialOrd<Asn1TimeRef> for Asn1Time
[src]