pub struct UtcTime(pub ASN1DateTime);
Tuple Fields
0: ASN1DateTime
Implementations
sourceimpl UtcTime
impl UtcTime
pub const fn new(datetime: ASN1DateTime) -> Self
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
sourcepub fn utc_datetime(&self) -> Result<OffsetDateTime>
pub fn utc_datetime(&self) -> Result<OffsetDateTime>
Return a ISO 8601 combined date and time with time zone.
sourcepub fn utc_adjusted_datetime(&self) -> Result<OffsetDateTime>
pub fn utc_adjusted_datetime(&self) -> Result<OffsetDateTime>
Return an adjusted ISO 8601 combined date and time with time zone. According to Universal time definition in X.680 we add 2000 years from 0 to 49 year and 1900 otherwise.
Trait Implementations
sourceimpl CheckDerConstraints for UtcTime
impl CheckDerConstraints for UtcTime
fn check_constraints(_any: &Any<'_>) -> Result<()>
sourceimpl Ord for UtcTime
impl Ord for UtcTime
sourceimpl PartialOrd<UtcTime> for UtcTime
impl PartialOrd<UtcTime> for UtcTime
sourcefn partial_cmp(&self, other: &UtcTime) -> Option<Ordering>
fn partial_cmp(&self, other: &UtcTime) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl ToDer for UtcTime
impl ToDer for UtcTime
sourcefn to_der_len(&self) -> Result<usize>
fn to_der_len(&self) -> Result<usize>
Get the length of the object, when encoded Read more
sourcefn write_der_header(&self, writer: &mut dyn Write) -> SerializeResult<usize>
fn write_der_header(&self, writer: &mut dyn Write) -> SerializeResult<usize>
Attempt to write the DER header to this writer.
sourcefn write_der_content(&self, writer: &mut dyn Write) -> SerializeResult<usize>
fn write_der_content(&self, writer: &mut dyn Write) -> SerializeResult<usize>
Attempt to write the DER content (all except header) to this writer.
sourcefn to_der_vec(&self) -> SerializeResult<Vec<u8>>
fn to_der_vec(&self) -> SerializeResult<Vec<u8>>
Write the DER encoded representation to a newly allocated Vec<u8>
.
sourcefn to_der_vec_raw(&self) -> SerializeResult<Vec<u8>>
fn to_der_vec_raw(&self) -> SerializeResult<Vec<u8>>
Similar to using to_vec
, but uses provided values without changes.
This can generate an invalid encoding for a DER object. Read more
sourcefn write_der(&self, writer: &mut dyn Write) -> SerializeResult<usize>
fn write_der(&self, writer: &mut dyn Write) -> SerializeResult<usize>
Attempt to write the DER encoded representation (header and content) into this writer. Read more
sourcefn write_der_raw(&self, writer: &mut dyn Write) -> SerializeResult<usize>
fn write_der_raw(&self, writer: &mut dyn Write) -> SerializeResult<usize>
Similar to using to_der
, but uses provided values without changes.
This can generate an invalid encoding for a DER object. Read more
impl DerAutoDerive for UtcTime
impl Eq for UtcTime
impl StructuralEq for UtcTime
impl StructuralPartialEq for UtcTime
Auto Trait Implementations
impl RefUnwindSafe for UtcTime
impl Send for UtcTime
impl Sync for UtcTime
impl Unpin for UtcTime
impl UnwindSafe for UtcTime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more