#codec #encoding-rules #serialization

no-std flexiber

Encoding and decoding of BER-TLV as described in ISO 7816-4, without allocations

2 releases

0.1.1 Nov 22, 2023
0.1.0 Nov 20, 2021

#581 in Encoding

Download history 164/week @ 2024-07-22 226/week @ 2024-07-29 95/week @ 2024-08-05 164/week @ 2024-08-12 83/week @ 2024-08-19 79/week @ 2024-08-26 81/week @ 2024-09-02 92/week @ 2024-09-09 76/week @ 2024-09-16 129/week @ 2024-09-23 197/week @ 2024-09-30 230/week @ 2024-10-07 199/week @ 2024-10-14 389/week @ 2024-10-21 148/week @ 2024-10-28 114/week @ 2024-11-04

898 downloads per month
Used in 5 crates (3 directly)

Apache-2.0 OR MIT

76KB
1.5K SLoC

flexiber

Encoding and decoding of BER-TLV as described in ISO 7816-4, without allocations.

Follows the approach taken in der, and then in simple-tlv.

License

flexiber is licensed under either of Apache License, Version 2.0 or MIT License at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

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.

Dependencies

~110–540KB
~11K SLoC