[][src]Crate simple_tlv

simple-tlv

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

5.2.1 SIMPLE-TLV data objects

Each SIMPLE-TLV data object shall consist of two or three consecutive fields: a mandatory tag field, a mandatory length field and a conditional value field. A record (see 7.3.1) may be a SIMPLE-TLV data object.

Credits

This library is a remix of RustCrypto/utils/der, with a view towards:

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

SIMPLE-TLV decoder.

Encoder

SIMPLE-TLV encoder.

Error

Error type.

Length

SIMPLE-TLV-encoded length.

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

SIMPLE-TLV data object.

Enums

ErrorKind

Error type.

Traits

Container

Multiple encodables in a container.

Decodable

Decoding trait.

Encodable

Encoding trait.

Tagged

Types with an associated SIMPLE-TLV Tag.

Type Definitions

Result

Result type.

TaggedSlice

Raw SIMPLE-TLV data object TaggedValue<Slice<'_>>.

Derive Macros

Decodable

Derive the Decodable trait on a struct.

Encodable

Derive the Encodable trait on a struct.