Trait rsa::PrivateKeyEncoding[][src]

pub trait PrivateKeyEncoding {
    fn to_pkcs1(&self) -> Result<Vec<u8>>;
fn to_pkcs8(&self) -> Result<Vec<u8>>; }
Expand description

Trait for encoding the private key in the PKCS#1/PKCS#8 format

Important: Encoding multi prime keys isn’t supported. See RustCrypto/RSA#66 for more info

Required methods

Encodes a Private key to into PKCS1 bytes.

This data will be base64 encoded which would be used following a -----BEGIN <name> PRIVATE KEY----- header.

https://tls.mbed.org/kb/cryptography/asn1-key-structures-in-der-and-pem

Encodes a Private key to into PKCS8 bytes.

This data will be base64 encoded which would be used following a -----BEGIN PRIVATE KEY----- header.

https://tls.mbed.org/kb/cryptography/asn1-key-structures-in-der-and-pem

Implementors