Trait PemEncode

Source
pub trait PemEncode: Sealed + Encode {
    // Required methods
    fn as_pkcs1_pem(&self) -> Result<String, Error>;
    fn as_pkcs8_pem(&self) -> Result<String, Error>;
    fn as_pkcs1_pem_custom_ending(
        &self,
        line_ending: LineEnding,
    ) -> Result<String, Error>;
    fn as_pkcs8_pem_custom_ending(
        &self,
        line_ending: LineEnding,
    ) -> Result<String, Error>;
}
Expand description

Trait for encoding the keys and wrapping them in the PEM format

Required Methods§

Source

fn as_pkcs1_pem(&self) -> Result<String, Error>

Encode in the PKCS#1 format, PEM encoded

Source

fn as_pkcs8_pem(&self) -> Result<String, Error>

Encode in the PKCS#8 format, PEM encoded

Source

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

Encode in the PKCS#1 format, PEM encoded with a custom line ending

Source

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

Encode in the PKCS#8 format, PEM encoded with a custom line ending

Implementations on Foreign Types§

Source§

impl PemEncode for RSAPrivateKey

Source§

fn as_pkcs1_pem(&self) -> Result<String, Error>

Line endings default to Unix-style LF

Source§

fn as_pkcs8_pem(&self) -> Result<String, Error>

Line endings default to Unix-style LF

Source§

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

Encode with a different line ending

Source§

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

Encode with a different line ending

Source§

impl PemEncode for RSAPublicKey

Source§

fn as_pkcs1_pem(&self) -> Result<String, Error>

Line endings default to Unix-style LF

Source§

fn as_pkcs8_pem(&self) -> Result<String, Error>

Line endings default to Unix-style LF

Source§

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

Encode with a different line ending

Source§

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

Encode with a different line ending

Implementors§