[][src]Struct pkcs8::AlgorithmIdentifier

pub struct AlgorithmIdentifier {
    pub oid: ObjectIdentifier,
    pub parameters: Option<AlgorithmParameters>,
}

X.509 AlgorithmIdentifier

Defined in RFC 5280 Section 4.1.1.2: https://tools.ietf.org/html/rfc5280#section-4.1.1.2

AlgorithmIdentifier  ::=  SEQUENCE  {
     algorithm               OBJECT IDENTIFIER,
     parameters              ANY DEFINED BY algorithm OPTIONAL  }

Fields

oid: ObjectIdentifier

Algorithm OID.

This is the algorithm field in the AlgorithmIdentifier ASN.1 schema.

parameters: Option<AlgorithmParameters>

Algorithm parameters.

According to RFC 5280, this technically contains algorithm-defined ANY data, however as this crate is specialized to RSA and ECC keys, we only support an OID in this field.

Implementations

impl AlgorithmIdentifier[src]

pub fn from_der(bytes: &[u8]) -> Result<Self>[src]

Parse AlgorithmIdentifier encoded as ASN.1 DER

pub fn write_der<'a>(&self, buffer: &'a mut [u8]) -> Result<&'a [u8]>[src]

Write ASN.1 DER-encoded AlgorithmIdentifier to the provided buffer, returning a slice containing the encoded data.

pub fn to_der(&self) -> Vec<u8>[src]

This is supported on crate feature alloc only.

Encode this AlgorithmIdentifier as ASN.1 DER

Trait Implementations

impl Clone for AlgorithmIdentifier[src]

impl Copy for AlgorithmIdentifier[src]

impl Debug for AlgorithmIdentifier[src]

impl Eq for AlgorithmIdentifier[src]

impl PartialEq<AlgorithmIdentifier> for AlgorithmIdentifier[src]

impl StructuralEq for AlgorithmIdentifier[src]

impl StructuralPartialEq for AlgorithmIdentifier[src]

impl<'_> TryFrom<&'_ [u8]> for AlgorithmIdentifier[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.