[][src]Function der_parser::parse_der

pub fn parse_der(i: &[u8]) -> DerResult<'_>

Parse DER object recursively

Return a tuple containing the remaining (unparsed) bytes and the DER Object, or an error.

*Note: this is the same as calling parse_der_recursive with MAX_RECURSION.

Example

use der_parser::der::{parse_der, DerTag};

let bytes = &[0x02, 0x03, 0x01, 0x00, 0x01];
let (_, obj) = parse_der(bytes).expect("parsing failed");

assert_eq!(obj.header.tag, DerTag::Integer);