Skip to main content

RsaPrivateKeyOwned

Type Alias RsaPrivateKeyOwned 

Source
pub type RsaPrivateKeyOwned = RsaPrivateKey<Uint>;
Expand description

PKCS#1 RSA Private Keys as defined in [RFC 8017 Appendix 1.2].

Owns its integer data. Use DecodeRsaPrivateKey and EncodeRsaPrivateKey for DER decoding and encoding, or PEM when the pem feature is enabled.

Aliased Type§

pub struct RsaPrivateKeyOwned {
    pub modulus: Uint,
    pub public_exponent: Uint,
    pub private_exponent: Uint,
    pub prime1: Uint,
    pub prime2: Uint,
    pub exponent1: Uint,
    pub exponent2: Uint,
    pub coefficient: Uint,
    pub other_prime_infos: Option<Vec<OtherPrimeInfo<Uint>>>,
}

Fields§

§modulus: Uint

n: RSA modulus.

§public_exponent: Uint

e: RSA public exponent.

§private_exponent: Uint

d: RSA private exponent.

§prime1: Uint

p: first prime factor of n.

§prime2: Uint

q: Second prime factor of n.

§exponent1: Uint

First exponent: d mod (p-1).

§exponent2: Uint

Second exponent: d mod (q-1).

§coefficient: Uint

CRT coefficient: (inverse of q) mod p.

§other_prime_infos: Option<Vec<OtherPrimeInfo<Uint>>>

Additional primes r_3, …, r_u, in order, if this is a multi-prime RSA key (i.e. version is multi).

Trait Implementations§

Source§

impl DecodeRsaPrivateKey for RsaPrivateKeyOwned

Available on crate feature alloc only.
Source§

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

Deserialize PKCS#1 private key from ASN.1 DER-encoded data (binary format).
Source§

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

Deserialize PKCS#1-encoded private key from PEM. Read more
Source§

fn read_pkcs1_der_file(path: impl AsRef<Path>) -> Result<Self>

Load PKCS#1 private key from an ASN.1 DER-encoded file on the local filesystem (binary format).
Source§

fn read_pkcs1_pem_file(path: impl AsRef<Path>) -> Result<Self>

Load PKCS#1 private key from a PEM-encoded file on the local filesystem.