Function der_parser::ber::ber_read_element_header[][src]

pub fn ber_read_element_header(i: &[u8]) -> BerResult<'_, BerObjectHeader<'_>>
Expand description

Read an object header

Example

let bytes = &[0x02, 0x03, 0x01, 0x00, 0x01];
let (i, hdr) = ber_read_element_header(bytes).expect("could not read header");

assert_eq!(hdr.class, BerClass::Universal);
assert_eq!(hdr.tag, BerTag::Integer);
assert_eq!(hdr.len, BerSize::Definite(3));