Authentication

Trait Authentication 

Source
pub trait Authentication {
    // Required methods
    fn secp(&self) -> &Secp256k1<All>;
    fn ver(&self) -> &str;
    fn pubkey(&self) -> &PublicKey;
    fn card_nonce(&self) -> &[u8; 16];
    fn set_card_nonce(&mut self, new_nonce: [u8; 16]);
    fn auth_delay(&self) -> &Option<usize>;
    fn set_auth_delay(&mut self, auth_delay: Option<usize>);
    fn transport(&self) -> Arc<dyn CkTransport>;

    // Provided method
    fn calc_ekeys_xcvc(
        &self,
        cvc: &str,
        command: &str,
    ) -> (SecretKey, PublicKey, Vec<u8>) { ... }
}
Expand description

Helper functions for authenticated commands.

Required Methods§

Source

fn secp(&self) -> &Secp256k1<All>

Source

fn ver(&self) -> &str

Source

fn pubkey(&self) -> &PublicKey

Source

fn card_nonce(&self) -> &[u8; 16]

Source

fn set_card_nonce(&mut self, new_nonce: [u8; 16])

Source

fn auth_delay(&self) -> &Option<usize>

Source

fn set_auth_delay(&mut self, auth_delay: Option<usize>)

Source

fn transport(&self) -> Arc<dyn CkTransport>

Provided Methods§

Source

fn calc_ekeys_xcvc( &self, cvc: &str, command: &str, ) -> (SecretKey, PublicKey, Vec<u8>)

Calculate ephemeral key pair and XOR’d CVC. ref: “Authenticating Commands with CVC”

Implementors§