pub struct AlgorithmIdentifier<'a> {
pub algorithm: ObjectIdentifier,
pub parameters: Option<Element<'a>>,
}Fields§
§algorithm: ObjectIdentifier§parameters: Option<Element<'a>>Implementations§
Source§impl<'a> AlgorithmIdentifier<'a>
impl<'a> AlgorithmIdentifier<'a>
Sourcepub fn from_der(data: &'a [u8]) -> Result<Self>
pub fn from_der(data: &'a [u8]) -> Result<Self>
Parse a DER-encoded AlgorithmIdentifier from borrowed bytes.
The returned value borrows from data for zero-copy fields.
Sourcepub fn to_der(&self) -> Result<Vec<u8>>
pub fn to_der(&self) -> Result<Vec<u8>>
Encode this value to DER bytes.
Returns a synta::Result wrapping the DER-encoded bytes,
or an error if encoding fails.
Sourcepub fn format_asn1(&self, mode: Asn1FormatMode) -> String
pub fn format_asn1(&self, mode: Asn1FormatMode) -> String
Format the encoded DER bytes of this value.
mode controls the output style:
synta::Asn1FormatMode::Hex— space-separated uppercase hex bytessynta::Asn1FormatMode::Text— indented human-readable ASN.1 dump
Trait Implementations§
Source§impl<'a> Clone for AlgorithmIdentifier<'a>
impl<'a> Clone for AlgorithmIdentifier<'a>
Source§fn clone(&self) -> AlgorithmIdentifier<'a>
fn clone(&self) -> AlgorithmIdentifier<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for AlgorithmIdentifier<'a>
impl<'a> Debug for AlgorithmIdentifier<'a>
Source§impl<'a> Decode<'a> for AlgorithmIdentifier<'a>
impl<'a> Decode<'a> for AlgorithmIdentifier<'a>
Source§impl<'a> DecodeImplicit<'a> for AlgorithmIdentifier<'a>
impl<'a> DecodeImplicit<'a> for AlgorithmIdentifier<'a>
Source§impl<'a> Encode for AlgorithmIdentifier<'a>
impl<'a> Encode for AlgorithmIdentifier<'a>
Source§impl<'a> PartialEq for AlgorithmIdentifier<'a>
impl<'a> PartialEq for AlgorithmIdentifier<'a>
Source§fn eq(&self, other: &AlgorithmIdentifier<'a>) -> bool
fn eq(&self, other: &AlgorithmIdentifier<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for AlgorithmIdentifier<'a>
Auto Trait Implementations§
impl<'a> Freeze for AlgorithmIdentifier<'a>
impl<'a> RefUnwindSafe for AlgorithmIdentifier<'a>
impl<'a> Send for AlgorithmIdentifier<'a>
impl<'a> Sync for AlgorithmIdentifier<'a>
impl<'a> Unpin for AlgorithmIdentifier<'a>
impl<'a> UnsafeUnpin for AlgorithmIdentifier<'a>
impl<'a> UnwindSafe for AlgorithmIdentifier<'a>
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§impl<T> TagForOptional for Twhere
T: Tagged,
impl<T> TagForOptional for Twhere
T: Tagged,
Source§fn optional_tag() -> Option<Tag>
fn optional_tag() -> Option<Tag>
Return the expected tag for optional-field peek-ahead, or
None if
the type accepts multiple tags (CHOICE) or any tag (ANY / Element<'a>).