Skip to main content

RsaPrivateKey

Type Alias RsaPrivateKey 

Source
pub type RsaPrivateKey = GenericRsaPrivateKey<BoxedUint, BoxedMontyParams>;
Available on crate feature alloc only.
Expand description

Boxed RSA private key alias used by the alloc code path.

from_public_and_d is unreachable through this alias — BoxedUint doesn’t impl [RawPrivateKeyConstructible]:

use rsa_heapless::RsaPrivateKey;
fn must_not_compile(pub_key: rsa_heapless::RsaPublicKey, d: crypto_bigint::BoxedUint) {
    let _: RsaPrivateKey = RsaPrivateKey::from_public_and_d(pub_key, d);
}

Aliased Type§

pub struct RsaPrivateKey { /* private fields */ }

Trait Implementations§

Source§

impl AsRef<GenericRsaPublicKey<BoxedUint, BoxedMontyParams>> for RsaPrivateKey

Source§

fn as_ref(&self) -> &RsaPublicKey

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl DecodeRsaPrivateKey for RsaPrivateKey

Available on crate feature encoding 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, Error>

Available on crate feature pem only.
Deserialize PKCS#1-encoded private key from PEM. Read more
Source§

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

Available on crate feature std only.
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, Error>

Available on crate features pem and std only.
Load PKCS#1 private key from a PEM-encoded file on the local filesystem.
Source§

impl<'de> Deserialize<'de> for RsaPrivateKey

Available on crate feature serde only.
Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl EncodePrivateKey for RsaPrivateKey

Available on crate feature encoding only.
Source§

fn to_pkcs8_der(&self) -> Result<SecretDocument>

Serialize a SecretDocument containing a PKCS#8-encoded private key. Read more
Source§

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

Available on crate feature pem only.
Serialize this private key as PEM-encoded PKCS#8 with the given LineEnding. Read more
Source§

fn write_pkcs8_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>

Available on crate feature std only.
Write ASN.1 DER-encoded PKCS#8 private key to the given path. Read more
Source§

fn write_pkcs8_pem_file( &self, path: impl AsRef<Path>, line_ending: LineEnding, ) -> Result<(), Error>

Available on crate features pem and std only.
Write ASN.1 PEM-encoded PKCS#8 private key to the given path. Read more
Source§

impl EncodeRsaPrivateKey for RsaPrivateKey

Available on crate feature encoding only.
Source§

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

Serialize a SecretDocument containing a PKCS#1-encoded private key.
Source§

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

Available on crate feature pem only.
Serialize this private key as PEM-encoded PKCS#1 with the given LineEnding.
Source§

fn write_pkcs1_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>

Available on crate feature std only.
Write ASN.1 DER-encoded PKCS#1 private key to the given path.
Source§

fn write_pkcs1_pem_file( &self, path: impl AsRef<Path>, line_ending: LineEnding, ) -> Result<(), Error>

Available on crate features pem and std only.
Write ASN.1 PEM-encoded PKCS#1 private key to the given path.
Source§

impl Eq for RsaPrivateKey

Source§

impl<D> From<BlindedSigningKey<D>> for RsaPrivateKey
where D: Digest,

Source§

fn from(key: BlindedSigningKey<D>) -> Self

Converts to this type from the input type.
Source§

impl<D> From<GenericSigningKey<D, BoxedUint, BoxedMontyParams>> for RsaPrivateKey
where D: Digest,

Source§

fn from(key: SigningKey<D>) -> Self

Converts to this type from the input type.
Source§

impl<D> From<GenericSigningKey<D, BoxedUint, BoxedMontyParams>> for RsaPrivateKey
where D: Digest,

Source§

fn from(key: SigningKey<D>) -> Self

Converts to this type from the input type.
Source§

impl Hash for RsaPrivateKey

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for RsaPrivateKey

Source§

fn eq(&self, other: &RsaPrivateKey) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for RsaPrivateKey

Available on crate feature serde only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<PrivateKeyInfo<AnyRef<'_>, &OctetStringRef, BitStringRef<'_>>> for RsaPrivateKey

Available on crate feature encoding only.
Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(private_key_info: PrivateKeyInfoRef<'_>) -> Result<Self>

Performs the conversion.
Source§

impl TryFrom<RsaPrivateKey<'_>> for RsaPrivateKey

Available on crate feature encoding only.
Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(pkcs1_key: RsaPrivateKey<'_>) -> Result<RsaPrivateKey>

Performs the conversion.