pub enum Time {
UtcTime(UtcTime),
GeneralTime(GeneralizedTime),
}Expand description
X.501 Time as defined in RFC 5280 Section 4.1.2.5.
Schema definition from RFC 5280 Appendix A:
Time ::= CHOICE {
utcTime UTCTime,
generalTime GeneralizedTime
}Variants§
UtcTime(UtcTime)
Legacy UTC time (has 2-digit year, valid from 1970 to 2049).
Note: RFC 5280 specifies 1950-2049, however due to common operations working on
UNIX_EPOCH this implementation’s lower bound is 1970.
GeneralTime(GeneralizedTime)
Modern GeneralizedTime encoding with 4-digit year.
Implementations§
Trait Implementations§
impl Copy for Time
Source§impl EncodeValue for Time
impl EncodeValue for Time
impl Eq for Time
Source§impl From<GeneralizedTime> for Time
impl From<GeneralizedTime> for Time
Source§fn from(time: GeneralizedTime) -> Time
fn from(time: GeneralizedTime) -> Time
Converts to this type from the input type.
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnsafeUnpin for Time
impl UnwindSafe for Time
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DecodeOwned for Twhere
T: for<'a> Decode<'a>,
Source§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
Source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
Source§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer.
Source§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Encode this value to the provided byte slice, returning a sub-slice
containing the encoded message.