Skip to main content

RsaPublicKeyEncoding

Trait RsaPublicKeyEncoding 

Source
pub trait RsaPublicKeyEncoding: Sized {
    // Required methods
    fn from_pkcs1_der(bytes: &[u8]) -> Result<Self>;
    fn to_pkcs1_der(&self) -> Result<Document>;
    fn from_public_key_der(bytes: &[u8]) -> Result<Self>;
    fn to_public_key_der(&self) -> Result<Document>;

    // Provided methods
    fn from_pkcs1_pem(pem: &str) -> Result<Self> { ... }
    fn to_pkcs1_pem(&self, ending: LineEnding) -> Result<String> { ... }
    fn from_public_key_pem(pem: &str) -> Result<Self> { ... }
    fn to_public_key_pem(&self, ending: LineEnding) -> Result<String> { ... }
}
Expand description

PKCS#1 and SubjectPublicKeyInfo codecs for the existing RSA public key.

Required Methods§

Source

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

Decode and validate a PKCS#1 public key.

Source

fn to_pkcs1_der(&self) -> Result<Document>

Encode a borrowed public key as PKCS#1.

Source

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

Decode a SubjectPublicKeyInfo with a validated algorithm identifier.

Source

fn to_public_key_der(&self) -> Result<Document>

Encode a borrowed public key as SubjectPublicKeyInfo.

Provided Methods§

Source

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

Decode a correctly labeled PKCS#1 PEM public key.

Source

fn to_pkcs1_pem(&self, ending: LineEnding) -> Result<String>

Encode a PKCS#1 public PEM key with explicit line endings.

Source

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

Decode a correctly labeled public-key PEM container.

Source

fn to_public_key_pem(&self, ending: LineEnding) -> Result<String>

Encode a public-key PEM container with explicit line endings.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl RsaPublicKeyEncoding for RsaPublicKey

Implementors§