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§
Sourcefn from_pkcs1_der(bytes: &[u8]) -> Result<Self>
fn from_pkcs1_der(bytes: &[u8]) -> Result<Self>
Decode and validate a PKCS#1 public key.
Sourcefn to_pkcs1_der(&self) -> Result<Document>
fn to_pkcs1_der(&self) -> Result<Document>
Encode a borrowed public key as PKCS#1.
Sourcefn from_public_key_der(bytes: &[u8]) -> Result<Self>
fn from_public_key_der(bytes: &[u8]) -> Result<Self>
Decode a SubjectPublicKeyInfo with a validated algorithm identifier.
Sourcefn to_public_key_der(&self) -> Result<Document>
fn to_public_key_der(&self) -> Result<Document>
Encode a borrowed public key as SubjectPublicKeyInfo.
Provided Methods§
Sourcefn from_pkcs1_pem(pem: &str) -> Result<Self>
fn from_pkcs1_pem(pem: &str) -> Result<Self>
Decode a correctly labeled PKCS#1 PEM public key.
Sourcefn to_pkcs1_pem(&self, ending: LineEnding) -> Result<String>
fn to_pkcs1_pem(&self, ending: LineEnding) -> Result<String>
Encode a PKCS#1 public PEM key with explicit line endings.
Sourcefn from_public_key_pem(pem: &str) -> Result<Self>
fn from_public_key_pem(pem: &str) -> Result<Self>
Decode a correctly labeled public-key PEM container.
Sourcefn to_public_key_pem(&self, ending: LineEnding) -> Result<String>
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".