Skip to main content

AtCaClient

Struct AtCaClient 

Source
pub struct AtCaClient<M: RawMutex, PHY> { /* private fields */ }

Implementations§

Source§

impl<M: RawMutex, PHY> AtCaClient<M, PHY>

Source

pub fn new(phy: PHY) -> Self

Create a new client with default I2C configuration

Source

pub fn with_config(phy: PHY, config: I2cConfig) -> Self

Create a new client with custom I2C configuration

Source

pub fn memory(&self) -> Memory<'_, M, PHY>

Source

pub fn aes(&self, key_id: Slot) -> Aes<'_, M, PHY>

Source

pub fn sha(&self) -> Sha<'_, M, PHY>

Source

pub fn signer(&self, key_id: Slot) -> SigningKey<'_, M, PHY>

Source

pub fn verifier(&self, key_id: Slot) -> VerifyingKey<'_, M, PHY>

Source

pub fn random(&self) -> Random<'_, M, PHY>

Source§

impl<M, PHY> AtCaClient<M, PHY>
where PHY: I2c, M: RawMutex,

Source

pub async fn tng(&self) -> Result<TrustAndGo<'_, M, PHY>, Error>

Source

pub async fn sleep(&self) -> Result<(), Error>

Source

pub async fn info(&self) -> Result<Word, Error>

Source

pub async fn write_message_digest_buffer( &self, msg: &Digest, ) -> Result<(), Error>

Write to device’s digest message buffer

Source

pub async fn create_private_key(&self, key_id: Slot) -> Result<PublicKey, Error>

Create private key and output its public key

Source

pub async fn write_private_key( &self, key_id: Slot, private_key: &Block, ) -> Result<(), Error>

Write private key to device

Source

pub async fn generate_pubkey(&self, key_id: Slot) -> Result<PublicKey, Error>

Given a private key created and stored in advance, calculate its public key

Source

pub async fn diffie_hellman( &self, key_id: Slot, public_key: PublicKey, ) -> Result<SharedSecret, Error>

Perform Diffie-Hellman key exchange

Source

pub async fn verify_external( &self, digest: &Digest, signature: &Signature, public_key: &PublicKey, ) -> Result<(), Error>

Verify a signature over a pre-hashed digest using an external public key.

Atomically writes the digest to the message buffer and executes the Verify command under a single lock acquisition.

Source§

impl<M, PHY> AtCaClient<M, PHY>
where PHY: I2c, M: RawMutex,

Source

pub fn sleep_blocking(&self) -> Result<(), Error>

Source

pub fn info_blocking(&self) -> Result<Word, Error>

Source

pub fn write_message_digest_buffer_blocking( &self, msg: &Digest, ) -> Result<(), Error>

Write to device’s digest message buffer

Source

pub fn create_private_key_blocking( &self, key_id: Slot, ) -> Result<PublicKey, Error>

Create private key and output its public key

Source

pub fn write_private_key_blocking( &self, key_id: Slot, private_key: &Block, ) -> Result<(), Error>

Write private key to device

Source

pub fn generate_pubkey_blocking(&self, key_id: Slot) -> Result<PublicKey, Error>

Given a private key created and stored in advance, calculate its public key

Source

pub fn diffie_hellman_blocking( &self, key_id: Slot, public_key: PublicKey, ) -> Result<SharedSecret, Error>

Perform Diffie-Hellman key exchange

Source

pub fn verify_external_blocking( &self, digest: &Digest, signature: &Signature, public_key: &PublicKey, ) -> Result<(), Error>

Verify a signature over a pre-hashed digest using an external public key.

Atomically writes the digest to the message buffer and executes the Verify command under a single lock acquisition.

Auto Trait Implementations§

§

impl<M, PHY> !Freeze for AtCaClient<M, PHY>

§

impl<M, PHY> !RefUnwindSafe for AtCaClient<M, PHY>

§

impl<M, PHY> Forget for AtCaClient<M, PHY>

§

impl<M, PHY> Move for AtCaClient<M, PHY>

§

impl<M, PHY> Send for AtCaClient<M, PHY>
where Mutex<M, Inner<PHY>>: Send,

§

impl<M, PHY> Sync for AtCaClient<M, PHY>
where Mutex<M, Inner<PHY>>: Sync,

§

impl<M, PHY> Unpin for AtCaClient<M, PHY>
where Mutex<M, Inner<PHY>>: Unpin,

§

impl<M, PHY> UnsafeUnpin for AtCaClient<M, PHY>
where Mutex<M, Inner<PHY>>: UnsafeUnpin,

§

impl<M, PHY> UnwindSafe for AtCaClient<M, PHY>
where Mutex<M, Inner<PHY>>: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.