capsules_extra::public_key_crypto::rsa_keys

Struct RSA2048KeysMut

Source
pub struct RSA2048KeysMut(/* private fields */);

Implementations§

Trait Implementations§

Source§

impl PubKeyMut for RSA2048KeysMut

Source§

fn import_public_key( &self, public_key: &'static mut [u8], ) -> Result<(), (ErrorCode, &'static mut [u8])>

Import an existing public key. Read more
Source§

fn pub_key(&self) -> Result<&'static mut [u8], ErrorCode>

Return the public key supplied by import_public_key() or generate(). Read more
Source§

fn len(&self) -> usize

Report the length of the public key in bytes, as returned from pub_key(). A value of 0 indicates that the key does not exist.
Source§

impl PubPrivKeyMut for RSA2048KeysMut

Source§

fn import_private_key( &self, private_key: &'static mut [u8], ) -> Result<(), (ErrorCode, &'static mut [u8])>

Import an existing private key. Read more
Source§

fn priv_key(&self) -> Result<&'static mut [u8], ErrorCode>

Return the private key supplied by import_private_key() or generate(). Read more
Source§

fn len(&self) -> usize

Report the length of the private key in bytes, as returned from priv_key(). A value of 0 indicates that the key does not exist.
Source§

impl RsaKeyMut for RSA2048KeysMut

Source§

fn map_modulus(&self, closure: &dyn Fn(&mut [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.
Source§

fn take_modulus(&self) -> Option<&'static mut [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.
Source§

fn public_exponent(&self) -> Option<u32>

Returns the public exponent of the key pair if it exists
Source§

impl RsaPrivKeyMut for RSA2048KeysMut

Source§

fn map_exponent(&self, closure: &dyn Fn(&mut [u8])) -> Option<()>

Returns the specified closure over the private exponent, if it exists The exponent is returned MSB (big endian) Returns Some() if the key exists and the closure was called, otherwise returns None.
Source§

fn take_exponent(&self) -> Option<&'static mut [u8]>

The the private exponent if it exists. The exponent is returned MSB (big endian) Returns Some() if the key exists otherwise returns None. The exponent can be returned by calling import_private_key() with the output of this function.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.