Struct fcp_cryptoauth::handshake_packet::HandshakePacket
[−]
[src]
pub struct HandshakePacket { pub raw: Vec<u8>, }
Represents a raw CryptoAuth packet, as defined by https://github.com/fc00/spec/blob/10b349ab11/cryptoauth.md#packet-layout
Fields
raw: Vec<u8>
Methods
impl HandshakePacket
[src]
fn packet_type(&self) -> Result<HandshakePacketType, u32>
Returns the session state of the packet if it is a known session state, as defined by https://github.com/fc00/spec/blob/10b349ab11/cryptoauth.md#protocol
Returns Err(value of field) if the session state field is set to an unknown value.
fn auth_challenge(&self) -> [u8; 12]
Returns a copy of the packet's Authorization Challenge.
fn random_nonce(&self) -> [u8; 24]
Returns a copy of the packet's Nonce.
fn sender_perm_pub_key(&self) -> [u8; 32]
Returns a copy of the packet's sender permanent public key, as a byte array.
fn msg_auth_code(&self) -> [u8; 16]
Returns a copy of the packet's Message Authentication Code.
fn sender_encrypted_temp_pub_key(&self) -> [u8; 32]
Returns a copy of the packet's sender temporary public key, encrypted and as a byte array.
fn encrypted_data(&self) -> &[u8]
Returns a reference to the packet's encrypted “piggy-backed” data.
fn sealed_data(&self) -> &[u8]
Returns msg_auth_code, sender_encrypted_temp_pub_key, and encrypted_data concatenated in that order. The purpose is to use it as input to the 'open' cryptographic primitive.