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
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>>
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 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.
impl Eq for Extension
impl StructuralPartialEq for Extension
Auto Trait Implementations§
impl !Freeze for Extension
impl RefUnwindSafe for Extension
impl Send for Extension
impl Sync for Extension
impl Unpin for Extension
impl UnwindSafe for Extension
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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)