Object identifiers
module OID : sig ... endObject identifiers.
ASN.1 Abstract Syntax
module S : sig ... endASN.1 Abstract Syntax.
Encoding formats
val ber : encodingber is ASN.1 Basic Encoding Rules (BER).
val der : encodingder is ASN.1 Distinguished Encoding Rules (DER).
Encoding and decoding
codec enc asn represents the syntax asn encoded under the rules enc.
This function performs work up-front, and is generally expected to be called in the static context on statically known syntaxes.
- raises Ambiguous_syntax
if
asncontainsCHOICEconstructs over sub-syntaxes with the same tags.
encode_into codec x is the pair (n, f), where n is the length of x encoded with codec, and f is a function that will write the encoded x to the first n bytes of the provided Cstruct.t.
val pp_error : Stdlib.Format.formatter -> error -> unitpp_error ppf err pretty-prints err on ppf.
val decode : 'a codec -> Cstruct.t -> ('a * Cstruct.t, error) Result.resultdecode codec cs is the pair (x, cs'), where x is the result of decoding the prefix of cs with codec and cs' are the trailing bytes, or an error.
Misc
val random : 'a t -> 'arandom asn is a random inhabitant of 'a.