Struct x509_certificate::rfc5280::Extension
source · pub struct Extension {
pub id: Oid,
pub critical: Option<bool>,
pub value: OctetString,
}
Expand description
Extension.
Extension ::= SEQUENCE {
extnID OBJECT IDENTIFIER,
critical BOOLEAN DEFAULT FALSE,
extnValue OCTET STRING
-- contains the DER encoding of an ASN.1 value
-- corresponding to the extension type identified
-- by extnID
}
Fields§
§id: Oid
§critical: Option<bool>
§value: OctetString
Implementations§
source§impl Extension
impl Extension
sourcepub fn take_opt_from<S: Source>(
cons: &mut Constructed<'_, S>
) -> Result<Option<Self>, DecodeError<S::Error>>
pub fn take_opt_from<S: Source>(
cons: &mut Constructed<'_, S>
) -> Result<Option<Self>, DecodeError<S::Error>>
pub fn take_from<S: Source>(
cons: &mut Constructed<'_, S>
) -> Result<Self, DecodeError<S::Error>>
sourcepub fn encode_ref(&self) -> impl Values + '_
pub fn encode_ref(&self) -> impl Values + '_
sourcepub fn try_decode_sequence_single_oid(&self) -> Option<Oid>
pub fn try_decode_sequence_single_oid(&self) -> Option<Oid>
Attempt to decode a single OID present in an outer sequence.
If this works, we return Some. Else None.
Trait Implementations§
source§impl PartialEq<Extension> for Extension
impl PartialEq<Extension> for Extension
source§impl Values for Extension
impl Values for Extension
source§fn encoded_len(&self, mode: Mode) -> usize
fn encoded_len(&self, mode: Mode) -> usize
Returns the length of the encoded values for the given mode.
source§fn write_encoded<W: Write>(&self, mode: Mode, target: &mut W) -> Result<(), Error>
fn write_encoded<W: Write>(&self, mode: Mode, target: &mut W) -> Result<(), Error>
Encodes the values in the given mode and writes them to
target
.source§fn explicit(self, tag: Tag) -> Constructed<Self>where
Self: Sized,
fn explicit(self, tag: Tag) -> Constructed<Self>where
Self: Sized,
Converts the encoder into one with an explicit tag.
source§fn to_captured(&self, mode: Mode) -> Captured
fn to_captured(&self, mode: Mode) -> Captured
Captures the encoded values in the given mode.