EncodePrivateKey

Trait EncodePrivateKey 

Source
pub trait EncodePrivateKey {
    // Required method
    fn to_pkcs8_der(&self) -> Result<SecretDocument, Error>;

    // Provided method
    fn to_pkcs8_pem(
        &self,
        line_ending: LineEnding,
    ) -> Result<Zeroizing<String>, Error> { ... }
}
Available on crate features pkcs8 and alloc only.
Expand description

Serialize a private key object to a PKCS#8 encoded document.

Required Methods§

Source

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

Serialize a SecretDocument containing a PKCS#8-encoded private key.

Provided Methods§

Source

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

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

Implementors§

Source§

impl<P> EncodePrivateKey for DecapsulationKey<P>
where P: KemParams + AssociatedAlgorithmIdentifier<Params = AnyRef<'static>>,