pub struct PublicKey(_);
Expand description

An RSA public key.

This implementation is a simple wrapper so that we can define new methods and traits on the type.

Implementations

Return true iff the exponent for this key is the same number as ‘e’.

Return the number of bits in the modulus for this key.

Try to check a signature (as used in Tor.) The signed hash should be in ‘hashed’, and the alleged signature in ‘sig’.

Tor uses RSA-PKCSv1 signatures, with hash algorithm OIDs omitted.

Decode an alleged DER byte string into a PublicKey.

Return None if the DER string does not have a valid PublicKey.

(This function expects an RsaPublicKey, as used by Tor. It does not expect or accept a PublicKeyInfo.)

Encode this public key into the DER format as used by Tor.

The result is an RsaPublicKey, not a PublicKeyInfo.

Compute the RsaIdentity for this public key.

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

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

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.