Enum simple_asn1::ASN1Block
source · pub enum ASN1Block {
Show 17 variants
Boolean(ASN1Class, usize, bool),
Integer(ASN1Class, usize, BigInt),
BitString(ASN1Class, usize, usize, Vec<u8>),
OctetString(ASN1Class, usize, Vec<u8>),
Null(ASN1Class, usize),
ObjectIdentifier(ASN1Class, usize, OID),
UTF8String(ASN1Class, usize, String),
PrintableString(ASN1Class, usize, String),
TeletexString(ASN1Class, usize, String),
IA5String(ASN1Class, usize, String),
UTCTime(ASN1Class, usize, DateTime<Utc>),
GeneralizedTime(ASN1Class, usize, DateTime<Utc>),
UniversalString(ASN1Class, usize, String),
BMPString(ASN1Class, usize, String),
Sequence(ASN1Class, usize, Vec<ASN1Block>),
Set(ASN1Class, usize, Vec<ASN1Block>),
Unknown(ASN1Class, usize, BigUint, Vec<u8>),
}
Expand description
A primitive block from ASN.1.
Primitive blocks all contain the class of the block and the offset from the beginning of the parsed document, followed by whatever data is associated with the block. The latter should be fairly self-explanatory, so let’s discuss the offset.
The offset is only valid during the reading process. It is ignored for
the purposes of encoding blocks into their binary form. It is also
ignored for the purpose of comparisons via ==
. It is included entirely
to support the parsing of things like X509 certificates, in which it is
necessary to know when particular blocks end.