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§
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 Methods§
Sourcefn calc_ekeys_xcvc(
&self,
cvc: &str,
command: &str,
) -> (SecretKey, PublicKey, Vec<u8>)
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”