Trait DeviceAuth

Source
pub trait DeviceAuth {
    // Required methods
    fn device_auth(&self, data: &[u8]) -> Result<()>;
    fn change_device_auth_key(&self, key: &[u8]) -> Result<()>;
}
Expand description

Device authentication

Required Methods§

Source

fn device_auth(&self, data: &[u8]) -> Result<()>

Device authentication

[data] - The authentication data

§authentication process
  1. Call the SKF_GetRandom function to get an 8-byte random number RND from the device, and pads it to the block size of the cryptographic algorithm with 0x00 to form the data block D0
  2. Encrypts D0 to get the encrypted result D1, and calls SKF_DevAuth, sending D1 to the device
  3. Upon receiving D1, the device verifies whether D1 is correct. If correct, the device authentication passes, otherwise the device authentication fails.
Source

fn change_device_auth_key(&self, key: &[u8]) -> Result<()>

Change device authentication key

[key] - The new authentication key

Implementors§