Skip to main content

PrivateKeyInfoRef

Type Alias PrivateKeyInfoRef 

Source
pub type PrivateKeyInfoRef<'a> = PrivateKeyInfo<AnyRef<'a>, &'a OctetStringRef, BitStringRef<'a>>;
Expand description

PrivateKeyInfo with AnyRef algorithm parameters, and &[u8] key.

Aliased Type§

pub struct PrivateKeyInfoRef<'a> {
    pub algorithm: AlgorithmIdentifier<AnyRef<'a>>,
    pub private_key: &'a OctetStringRef,
    pub public_key: Option<BitStringRef<'a>>,
}

Fields§

§algorithm: AlgorithmIdentifier<AnyRef<'a>>

X.509 AlgorithmIdentifier for the private key type.

§private_key: &'a OctetStringRef

Private key data. Exact content format is different between algorithms.

§public_key: Option<BitStringRef<'a>>

Public key data, optionally available if version is V2.

Trait Implementations§

Source§

impl EncodePrivateKey for PrivateKeyInfoRef<'_>

Source§

fn to_pkcs8_der(&self) -> Result<SecretDocument>

Serialize a SecretDocument containing a PKCS#8-encoded private key. Read more
Source§

fn to_pkcs8_pem(&self, line_ending: LineEnding) -> Result<Zeroizing<String>>

Serialize this private key as PEM-encoded PKCS#8 with the given LineEnding. Read more
Source§

fn write_pkcs8_der_file(&self, path: impl AsRef<Path>) -> Result<()>

Write ASN.1 DER-encoded PKCS#8 private key to the given path. Read more
Source§

fn write_pkcs8_pem_file( &self, path: impl AsRef<Path>, line_ending: LineEnding, ) -> Result<()>

Write ASN.1 PEM-encoded PKCS#8 private key to the given path. Read more
Source§

impl<'a> RefToOwned<'a> for PrivateKeyInfoRef<'a>

Source§

type Owned = PrivateKeyInfo<Any, OctetString, BitString>

The resulting type after obtaining ownership.
Source§

fn ref_to_owned(&self) -> Self::Owned

Creates a new object taking ownership of the data