pub struct AtCaClient<M: RawMutex, PHY> { /* private fields */ }Implementations§
Source§impl<M: RawMutex, PHY> AtCaClient<M, PHY>
impl<M: RawMutex, PHY> AtCaClient<M, PHY>
Sourcepub fn with_config(phy: PHY, config: I2cConfig) -> Self
pub fn with_config(phy: PHY, config: I2cConfig) -> Self
Create a new client with custom I2C configuration
pub fn memory(&self) -> Memory<'_, M, PHY>
pub fn aes(&self, key_id: Slot) -> Aes<'_, M, PHY>
pub fn sha(&self) -> Sha<'_, M, PHY>
pub fn signer(&self, key_id: Slot) -> SigningKey<'_, M, PHY>
pub fn verifier(&self, key_id: Slot) -> VerifyingKey<'_, M, PHY>
pub fn random(&self) -> Random<'_, M, PHY>
Source§impl<M, PHY> AtCaClient<M, PHY>
impl<M, PHY> AtCaClient<M, PHY>
pub async fn tng(&self) -> Result<TrustAndGo<'_, M, PHY>, Error>
pub async fn sleep(&self) -> Result<(), Error>
pub async fn info(&self) -> Result<Word, Error>
Sourcepub async fn write_message_digest_buffer(
&self,
msg: &Digest,
) -> Result<(), Error>
pub async fn write_message_digest_buffer( &self, msg: &Digest, ) -> Result<(), Error>
Write to device’s digest message buffer
Sourcepub async fn create_private_key(&self, key_id: Slot) -> Result<PublicKey, Error>
pub async fn create_private_key(&self, key_id: Slot) -> Result<PublicKey, Error>
Create private key and output its public key
Sourcepub async fn write_private_key(
&self,
key_id: Slot,
private_key: &Block,
) -> Result<(), Error>
pub async fn write_private_key( &self, key_id: Slot, private_key: &Block, ) -> Result<(), Error>
Write private key to device
Sourcepub async fn generate_pubkey(&self, key_id: Slot) -> Result<PublicKey, Error>
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
Sourcepub async fn diffie_hellman(
&self,
key_id: Slot,
public_key: PublicKey,
) -> Result<SharedSecret, Error>
pub async fn diffie_hellman( &self, key_id: Slot, public_key: PublicKey, ) -> Result<SharedSecret, Error>
Perform Diffie-Hellman key exchange
Sourcepub async fn verify_external(
&self,
digest: &Digest,
signature: &Signature,
public_key: &PublicKey,
) -> Result<(), Error>
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>
impl<M, PHY> AtCaClient<M, PHY>
pub fn sleep_blocking(&self) -> Result<(), Error>
pub fn info_blocking(&self) -> Result<Word, Error>
Sourcepub fn write_message_digest_buffer_blocking(
&self,
msg: &Digest,
) -> Result<(), Error>
pub fn write_message_digest_buffer_blocking( &self, msg: &Digest, ) -> Result<(), Error>
Write to device’s digest message buffer
Sourcepub fn create_private_key_blocking(
&self,
key_id: Slot,
) -> Result<PublicKey, Error>
pub fn create_private_key_blocking( &self, key_id: Slot, ) -> Result<PublicKey, Error>
Create private key and output its public key
Sourcepub fn write_private_key_blocking(
&self,
key_id: Slot,
private_key: &Block,
) -> Result<(), Error>
pub fn write_private_key_blocking( &self, key_id: Slot, private_key: &Block, ) -> Result<(), Error>
Write private key to device
Sourcepub fn generate_pubkey_blocking(&self, key_id: Slot) -> Result<PublicKey, Error>
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
Sourcepub fn diffie_hellman_blocking(
&self,
key_id: Slot,
public_key: PublicKey,
) -> Result<SharedSecret, Error>
pub fn diffie_hellman_blocking( &self, key_id: Slot, public_key: PublicKey, ) -> Result<SharedSecret, Error>
Perform Diffie-Hellman key exchange
Sourcepub fn verify_external_blocking(
&self,
digest: &Digest,
signature: &Signature,
public_key: &PublicKey,
) -> Result<(), Error>
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.