[][src]Struct pkcs8::PrivateKeyInfo

pub struct PrivateKeyInfo<'a> {
    pub algorithm: AlgorithmIdentifier,
    pub private_key: &'a [u8],
}

PKCS#8 PrivateKeyInfo

ASN.1 structure containing an AlgorithmIdentifier and private key data in an algorithm specific format.

Described in RFC 5208 Section 5: https://tools.ietf.org/html/rfc5208#section-5

PrivateKeyInfo ::= SEQUENCE {
        version                   Version,
        privateKeyAlgorithm       PrivateKeyAlgorithmIdentifier,
        privateKey                PrivateKey,
        attributes           [0]  IMPLICIT Attributes OPTIONAL }

Version ::= INTEGER

PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier

PrivateKey ::= OCTET STRING

Attributes ::= SET OF Attribute

Fields

algorithm: AlgorithmIdentifierprivate_key: &'a [u8]

Private key data

Implementations

impl<'a> PrivateKeyInfo<'a>[src]

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

Parse PrivateKeyInfo encoded as ASN.1 DER.

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

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

pub fn to_der(&self) -> PrivateKeyDocument[src]

This is supported on crate feature alloc only.

Encode this PrivateKeyInfo as ASN.1 DER.

pub fn to_pem(&self) -> Zeroizing<String>[src]

This is supported on crate feature pem only.

Encode this PrivateKeyInfo as PEM-encoded ASN.1 DER.

Trait Implementations

impl<'a> Clone for PrivateKeyInfo<'a>[src]

impl<'a> Copy for PrivateKeyInfo<'a>[src]

impl<'a> Debug for PrivateKeyInfo<'a>[src]

impl<'a> Message<'a> for PrivateKeyInfo<'a>[src]

impl<'a> TryFrom<&'a [u8]> for PrivateKeyInfo<'a>[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<Any<'a>> for PrivateKeyInfo<'a>[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<'a> RefUnwindSafe for PrivateKeyInfo<'a>[src]

impl<'a> Send for PrivateKeyInfo<'a>[src]

impl<'a> Sync for PrivateKeyInfo<'a>[src]

impl<'a> Unpin for PrivateKeyInfo<'a>[src]

impl<'a> UnwindSafe for PrivateKeyInfo<'a>[src]

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.