Struct rsa::RsaPublicKey

source ·
pub struct RsaPublicKey { /* private fields */ }
Expand description

Represents the public part of an RSA key.

Implementations

Minimum value of the public exponent e.

Maximum value of the public exponent e.

Maximum size of the modulus n in bits.

Create a new public key from its components.

This function accepts public keys with a modulus size up to 4096-bits, i.e. RsaPublicKey::MAX_SIZE.

Create a new public key from its components.

Create a new public key, bypassing checks around the modulus and public exponent size.

This method is not recommended, and only intended for unusual use cases. Most applications should use RsaPublicKey::new or RsaPublicKey::new_with_max_size instead.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.
Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize object from ASN.1 DER-encoded [SubjectPublicKeyInfo] (binary format). Read more
Deserialize PEM-encoded [SubjectPublicKeyInfo]. Read more
Load public key object from an ASN.1 DER-encoded file on the local filesystem (binary format). Read more
Load public key object from a PEM-encoded file on the local filesystem.
Deserialize this value from the given Serde deserializer. Read more
Serialize a [Document] containing a SPKI-encoded public key.
Serialize this public key as PEM-encoded SPKI with the given [LineEnding].
Write ASN.1 DER-encoded public key to the given path
Write ASN.1 DER-encoded public key to the given path
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Encrypt the given message.
Verify a signed message. hashedmust be the result of hashing the input using the hashing function passed in through hash. If the message is valid Ok(()) is returned, otherwiese an Err indicating failure. 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
The type returned in the event of a conversion error.
Performs the conversion.

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
Deserialize object from ASN.1 DER-encoded RsaPublicKey (binary format). Read more
Deserialize PEM-encoded RsaPublicKey. Read more
Load RsaPublicKey from an ASN.1 DER-encoded file on the local filesystem (binary format). Read more
Load RsaPublicKey from a PEM-encoded file on the local filesystem.
Serialize a [Document] containing a PKCS#1-encoded public key.
Serialize this public key as PEM-encoded PKCS#1 with the given line ending.
Write ASN.1 DER-encoded public key to the given path.
Write ASN.1 DER-encoded public key to the given path.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.