Function der_parser::der::parse_der_content2[][src]

pub fn parse_der_content2<'a>(
    tag: DerTag
) -> impl Fn(&'a [u8], DerObjectHeader<'a>, usize) -> BerResult<'a, DerObjectContent<'a>>
Expand description

Parse the next bytes as the content of a DER object (combinator, owned header)

Content type is not checked to match tag, caller is responsible of providing the correct tag

Caller is also responsible to check if parsing function consumed the expected number of bytes (header.len).

The arguments of the parse function are: (input, ber_object_header, max_recursion).

This function differs from parse_der_content because it passes an owned BER object header (required for ex. by parse_der_tagged_implicit_g).

Example: manually parsing header and content

let (i, header) = der_read_element_header(bytes).expect("parsing failed");
let (rem, content) = parse_der_content2(header.tag)(i, header, MAX_RECURSION)
    .expect("parsing failed");