Skip to main content

parse_key_information

Function parse_key_information 

Source
pub fn parse_key_information(data: &[u8]) -> Result<KeyInformation, TlvError>
Expand description

Parse the Key Information Template (value of GET DATA '00E0'; §11.3.3.1).

Accepts the response either wrapped in the outer 'E0' tag or as a bare sequence of 'C0' Key Information Data entries. Each 'C0' is KVN | KID | (KeyType KeyLength)+ in basic format, or KVN | KID | 'B9' … in extended format. Entries are grouped into Keysets by KVN.

§Errors

Returns TlvError if the template is not well-formed BER-TLV, or TlvError::TooMany if the entries exceed MAX_KEYSETS / MAX_KEYS_PER_SET.