Skip to main content

Module ber

Module ber 

Source
Expand description

Minimal ASN.1 BER encoder/decoder. Minimal ASN.1 BER encoder/decoder for SLE.

Implements only the subset needed by SLE: INTEGER, OCTET STRING, SEQUENCE, CHOICE, ENUMERATED, NULL, BIT STRING, BOOLEAN. No heap allocation — all operations work on caller-provided byte slices.

Modules§

tags
Well-known universal tag numbers.

Structs§

BerReader
A BER reader that decodes TLV elements from a byte slice.
BerWriter
A BER writer that encodes TLV elements into a byte slice.
SeqStart
Bookkeeping for an in-progress SEQUENCE or tagged wrapper.

Enums§

Class
ASN.1 tag class.

Functions§

decode_length
Decodes a BER length field.
decode_tag
Decodes a BER tag byte.
encode_length
Encodes a BER length into buf. Returns number of bytes written.
encode_tag
Encodes a single-byte tag octet.