Type Alias asn1_rs::ApplicationExplicit
source · pub type ApplicationExplicit<T, E, const TAG: u32> = TaggedValue<T, E, Explicit, { Class::APPLICATION }, TAG>;
Expand description
A helper object to parse [APPLICATION n] EXPLICIT T
A helper object implementing FromBer
and FromDer
, to
parse explicit application-tagged values.
§Examples
To parse a [APPLICATION 0] EXPLICIT INTEGER
object:
use asn1_rs::{ApplicationExplicit, Error, FromBer, Integer, TaggedValue};
let bytes = &[0x60, 0x03, 0x2, 0x1, 0x2];
// If tagged object is present (and has expected tag), parsing succeeds:
let (_, tagged) = ApplicationExplicit::<Integer, Error, 0>::from_ber(bytes).unwrap();
assert_eq!(tagged, TaggedValue::explicit(Integer::from(2)));
Aliased Type§
struct ApplicationExplicit<T, E, const TAG: u32> { /* private fields */ }