Module asn1

Source

Macros§

asn1_tagged
Macro to generate a ASN1Tagged and ViewWithASN1Tagged trait impl

Structs§

ASN1
A combinator wrapper that also emits a tag before parsing/serializing the inner value
ASN1Tag
Combinator for ASN.1 tags
Base128UInt
Combinator for a single identifier component in the OBJECT IDENTIFIER ASN.1 type (called “arc” X.690)
BigInt
If it’s expected that an INTEGER field is larger than the Int type, then use this combinator to read it as an octet string (with some minimality constraints).
BigIntOwned
BigIntValue
BitString
Combainator for BIT STRING in ASN.1 Essentially a refined version of OctetString where we require that the first bit correctly specifies the trailing zeros
BitStringValue
BitStringValueOwned
Boolean
Combainator for BOOLEAN in ASN.1 TRUE = 0x01 0x01 0xff FALSE = 0x01 0x01 0x00
ExplicitTag
Explicit tagging wrapps the inner combinator in a new TLV tuple Equivalent to ImplicitTag(tag, LengthWrapped(inner))
GeneralizedTime
TODO: this file is a bit of mess, clean it up
GeneralizedTimeInner
GeneralizedTimeValueInner
IA5String
Combinator for IA5String in ASN.1 Essentially a wrapper around Octet that checks that each byte is <= 127
IA5StringPred
A condition that the minimal encoding is used
ImplicitTag
Implicit tagging replaces the tag value in the ASN1Tagged trait, but otherwise parses/serializes exactly the same way as the inner combinator
Integer
Combinator for ASN.1 integers (without the preceding tag) This combinator uses IntegerInner with the additional constraint of is_min_num_bytes_signed
Length
Combinator for the length field in a TLV tuple
LengthWrapped
Wrap the inner combinator in a Length-Buffer pair
LengthWrappedCont
The function |i| AndThen<Bytes, T>
MinimalBigIntPred
A condition that the minimal encoding is used
Null
Combainator for NULL in ASN.1 NULL = 05 00 (with tag)
NullValue
ObjectIdentifier
Combinator for ASN.1 Object Identifier
ObjectIdentifierValue
OctetString
Combainator for OCTET STRING in ASN.1
PrintableString
Combinator for PrintableString in ASN.1 Essentially a wrapper around Octet that checks that each byte is <= 127
PrintableStringPred
A condition that the minimal encoding is used
SequenceOf
SEQUENCE OF in ASN.1
TagValue
UTCTime
Parse UTCTime string in 6 formats
UTCTimeInner
UTCTimeValueInner
UTF8String
Combainator for UTF8String in ASN.1
VarInt
VarUInt
Combinator for variable-length integers in big-endian The length is assumed to be <= uint_size!()

Enums§

GeneralizedTimeZone
TagClass
TagForm
UTCTimeZone

Traits§

ASN1Tagged
A trait for combinators to mark their original tags (e.g. 0x02 for INTEGER)
ViewWithASN1Tagged
An additional property that if an ASN1Tagged implements View, then the viewed version preserves the tag

Functions§

two_chars_to_u8
u8_to_two_chars

Type Aliases§

GeneralizedTimeValue
GeneralizedTimeValueOwned
IA5StringValue
IA5StringValueOwned
IntegerValue
LengthValue
NOTE: this should fit into a VarUIntResult
ObjectIdentifierValueOwned
PrintableStringValue
PrintableStringValueOwned
SequenceOfValue
SpecBigIntValue
BigInt represents the integer with a sequence of bytes in big-endian order (same as ASN.1) and the most significant bit of the first byte is the sign bit.
SpecBitStringValue
SpecGeneralizedTimeValue
SpecIA5StringValue
SpecObjectIdentifierValue
SpecPrintableStringValue
SpecUTCTimeValue
SpecUTF8StringValue
UInt
Signed/unsigned integer types used to represent values in ASN.1 All definitions below are relative to these two types
UTCTimeValue
UTCTimeValueOwned
UTF8StringValue
UTF8StringValueOwned
VarIntResult
VarUIntResult