Type Alias rocket::mtls::oid::asn1_rs::PrivateExplicit

source ·
pub type PrivateExplicit<T, E, const TAG: u32> = TaggedValue<T, E, Explicit, asn1_rs::::asn1_types::tagged::private::PrivateExplicit::{constant#0}, TAG>;
Available on crate feature mtls only.
Expand description

A helper object to parse [PRIVATE n] EXPLICIT T

A helper object implementing FromBer and FromDer, to parse explicit private-tagged values.

§Examples

To parse a [PRIVATE 0] EXPLICIT INTEGER object:

use asn1_rs::{Error, FromBer, Integer, PrivateExplicit, TaggedValue};

let bytes = &[0xe0, 0x03, 0x2, 0x1, 0x2];

// If tagged object is present (and has expected tag), parsing succeeds:
let (_, tagged) = PrivateExplicit::<Integer, Error, 0>::from_ber(bytes).unwrap();
assert_eq!(tagged, TaggedValue::explicit(Integer::from(2)));

Aliased Type§

struct PrivateExplicit<T, E, const TAG: u32> { /* private fields */ }