pub trait RsaKey: PubKey {
// Required methods
fn map_modulus(&self, closure: &dyn Fn(&[u8])) -> Option<()>;
fn take_modulus(&self) -> Option<&'static [u8]>;
fn public_exponent(&self) -> Option<u32>;
}
Required Methods§
Sourcefn map_modulus(&self, closure: &dyn Fn(&[u8])) -> Option<()>
fn map_modulus(&self, closure: &dyn Fn(&[u8])) -> Option<()>
Run the specified closure over the modulus, if it exists
The modulus is returned MSB (big endian)
Returns Some()
if the key exists and the closure was called,
otherwise returns None
.
Sourcefn take_modulus(&self) -> Option<&'static [u8]>
fn take_modulus(&self) -> Option<&'static [u8]>
The the modulus if it exists.
The modulus is returned MSB (big endian)
Returns Some()
if the key exists otherwise returns None
.
The modulus can be returned by calling import_public_key()
with
the output of this function.
Sourcefn public_exponent(&self) -> Option<u32>
fn public_exponent(&self) -> Option<u32>
Returns the public exponent of the key pair if it exists