Crate flexiber

Source
Expand description

§flexiber

Implementation of the BER-TLV serialization format from ISO 7816-4:2005.

ITU-T X.690 (08/2015) defines the BER, CER and DER encoding rules for ASN.1

The exact same document is ISO/IET 8825-1, which is freely available, inconveniently packed as a single PDF in a ZIP file :)

§Credits

This library is a remix of RustCrypto/utils/der.

The core idea taken from der is to have Encodable require an encoded_length method. By calling this recursively in a first pass, allocations required in other approaches are avoided.

Structs§

Decoder
BER-TLV decoder.
Encoder
BER-TLV encoder.
Error
Error type.
Length
BER-TLV-encoded length.
SimpleTag
These are tags like in SIMPLE-TLV.
Slice
Slice of at most Length::max() bytes.
Tag
The tag field consists of a single byte encoding a tag number from 1 to 254. The values ‘00’ and ‘FF’ are invalid.
TaggedValue
BER-TLV data object.

Enums§

Class
Class of BER tag.
ErrorKind
Error type.

Traits§

Container
Multiple encodables in a container.
Decodable
Decoding trait.
Encodable
Encoding trait.
TagLike
This is the common trait that types to be used as tags are supposed to implement.
Tagged
Types with an associated BER-TLV Tag.

Type Aliases§

Result
Result type.
TaggedSlice
Raw BER-TLV data object TaggedValue<Slice<'_>>.