Skip to main content

PrivateKeyInfoOwned

Type Alias PrivateKeyInfoOwned 

Source
pub type PrivateKeyInfoOwned = PrivateKeyInfo<Any, OctetString, BitString>;
Expand description

PrivateKeyInfo with Any algorithm parameters, and Box<[u8]> key.

Aliased Type§

pub struct PrivateKeyInfoOwned {
    pub algorithm: AlgorithmIdentifier<Any>,
    pub private_key: OctetString,
    pub public_key: Option<BitString>,
}

Fields§

§algorithm: AlgorithmIdentifier<Any>

X.509 AlgorithmIdentifier for the private key type.

§private_key: OctetString

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

§public_key: Option<BitString>

Public key data, optionally available if version is V2.

Trait Implementations§

Source§

impl DecodePrivateKey for PrivateKeyInfoOwned

Source§

fn from_pkcs8_der(bytes: &[u8]) -> Result<Self>

Deserialize PKCS#8 private key from ASN.1 DER-encoded data (binary format). Read more
Source§

fn from_pkcs8_pem(pem: &str) -> Result<Self>

Deserialize PKCS#8-encoded private key from PEM. Read more
Source§

fn read_pkcs8_der_file(path: impl AsRef<Path>) -> Result<Self>

Load PKCS#8 private key from an ASN.1 DER-encoded file (binary format) on the local filesystem. Read more
Source§

fn read_pkcs8_pem_file(path: impl AsRef<Path>) -> Result<Self>

Load PKCS#8 private key from a PEM-encoded file on the local filesystem. Read more
Source§

impl EncodePrivateKey for PrivateKeyInfoOwned

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 OwnedToRef for PrivateKeyInfoOwned

Source§

type Borrowed<'a> = PrivateKeyInfo<AnyRef<'a>, &'a OctetStringRef, BitStringRef<'a>>

The resulting type referencing back to Self
Source§

fn owned_to_ref(&self) -> Self::Borrowed<'_>

Creates a new object referencing back to the self for storage