Struct pkcs8::AlgorithmIdentifier[][src]

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, i.e. the algorithm field in the AlgorithmIdentifier ASN.1 schema.

parameters: Option<AlgorithmParameters>

Algorithm parameters.

Implementations

impl AlgorithmIdentifier[src]

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

Parse AlgorithmIdentifier encoded as ASN.1 DER

pub fn parameters_oid(&self) -> Option<ObjectIdentifier>[src]

Get the parameters field as an ObjectIdentifier.

Returns None if it is absent or not an OID.

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<'a> Message<'a> 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.

impl TryFrom<Any<'_>> 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<'a, T> Decodable<'a> for T where
    T: TryFrom<Any<'a>, Error = Error>, 
[src]

impl<'a, M> Encodable for M where
    M: Message<'a>, 
[src]

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

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

impl<'a, M> Tagged for M where
    M: Message<'a>, 
[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.