pub fn parse_ber_tagged_explicit<'a, T, F, E>(
    tag: u32,
    f: F
) -> impl Fn(&'a [u8]) -> IResult<&'a [u8], T, E>where
    F: Fn(&'a [u8]) -> IResult<&'a [u8], T, E>,
    E: ParseError<&'a [u8]> + From<BerError>,
Expand description

Read a TAGGED EXPLICIT value (function version)

The following parses [2] EXPLICIT INTEGER:

use nom::combinator::map_res;
fn parse_int_explicit(i:&[u8]) -> BerResult<u32> {
    parse_ber_tagged_explicit(
        2,
        parse_ber_u32
    )(i)
}

let res = parse_int_explicit(bytes);