Struct rsa::RsaPrivateKey[][src]

pub struct RsaPrivateKey { /* fields omitted */ }
Expand description

Represents a whole RSA key, public and private parts.

Implementations

This is supported on crate feature alloc only.

Generate a new Rsa key pair of the given bit size using the passed in rng.

This is supported on crate feature alloc only.

Generate a new RSA key pair of the given bit size and the public exponent using the passed in rng.

Unless you have specific needs, you should use RsaPrivateKey::new instead.

This is supported on crate feature alloc only.

Constructs an RSA key pair from the individual components.

This is supported on crate feature alloc only.

Get the public key from the private key, cloning n and e.

Generally this is not needed since RsaPrivateKey implements the PublicKey trait, but it can occationally be useful to discard the private information entirely.

This is supported on crate feature alloc only.

Performs some calculations to speed up private key operations.

This is supported on crate feature alloc only.

Returns the private exponent of the key.

This is supported on crate feature alloc only.

Returns the prime factors.

This is supported on crate feature alloc only.

Performs basic sanity checks on the key. Returns Ok(()) if everything is good, otherwise an approriate error.

This is supported on crate feature alloc only.

Decrypt the given message.

This is supported on crate feature alloc only.

Decrypt the given message.

Uses rng to blind the decryption process.

This is supported on crate feature alloc only.

Sign the given digest.

This is supported on crate feature alloc only.

Sign the given digest.

Use rng for blinding.

Methods from Deref<Target = RsaPublicKey>

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Deserialize this value from the given Serde deserializer. Read more

Executes the destructor for this type. Read more

Performs the conversion.

Performs the conversion.

Parse the RsaPrivateKey from a PKCS#1-encoded document.

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

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

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

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Returns the modulus of the key.

Returns the public exponent of the key.

Returns the modulus size in bytes. Raw signatures and ciphertexts for or by this public key will have the same size. Read more

Returns the modulus of the key.

Returns the public exponent of the key.

Returns the modulus size in bytes. Raw signatures and ciphertexts for or by this public key will have the same size. Read more

Serialize this value into the given Serde serializer. Read more

Serialize a RsaPrivateKeyDocument containing a PKCS#1-encoded private key.

Serialize this private key as PEM-encoded PKCS#1.

Serialize this private key as PEM-encoded PKCS#1 with the given LineEnding.

Write ASN.1 DER-encoded PKCS#1 private key to the given path.

Write ASN.1 DER-encoded PKCS#1 private key to the given path.

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Parse the PrivateKeyInfo from a PKCS#8-encoded document.

Deserialize PKCS#8 private key from ASN.1 DER-encoded data (binary format). Read more

Deserialize PKCS#8 private key from a PrivateKeyDocument.

Deserialize PKCS#8-encoded private key from PEM. Read more

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

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

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Serialize a PrivateKeyDocument containing a PKCS#8-encoded private key.

Serialize this private key as PEM-encoded PKCS#8.

Serialize this private key as PEM-encoded PKCS#8 with the given LineEnding.

Write ASN.1 DER-encoded PKCS#8 private key to the given path

Write ASN.1 DER-encoded PKCS#8 private key to the given path

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.