pub type TaggedImplicit<T, const TAG: u32> = TaggedValue<T, Implicit, {_: u8}, TAG>;
Available on crate feature mtls only.
Expand description

A helper object to parse [ n ] IMPLICIT T

A helper object implementing FromBer and FromDer, to parse tagged optional values.

This helper expects context-specific tags. See TaggedValue or TaggedParser for more generic implementations if needed.


To parse a [0] IMPLICIT INTEGER OPTIONAL object:

use asn1_rs::{FromBer, Integer, TaggedImplicit, TaggedValue};

let bytes = &[0xa0, 0x1, 0x2];

let (_, tagged) = TaggedImplicit::<Integer, 0>::from_ber(bytes).unwrap();
assert_eq!(tagged, TaggedValue::implicit(Integer::from(2)));