7 unstable releases (3 breaking)

✓ Uses Rust 2018 edition

new 0.4.0 Sep 9, 2019
0.3.1 Jul 8, 2019
0.3.0 May 31, 2019
0.2.2 Sep 9, 2019
0.1.0 Oct 23, 2018

#112 in Encoding

Download history 53/week @ 2019-05-27 138/week @ 2019-06-03 85/week @ 2019-06-10 55/week @ 2019-06-17 86/week @ 2019-06-24 48/week @ 2019-07-01 65/week @ 2019-07-08 111/week @ 2019-07-15 115/week @ 2019-07-22 40/week @ 2019-07-29 55/week @ 2019-08-05 46/week @ 2019-08-12 67/week @ 2019-08-19 33/week @ 2019-08-26 76/week @ 2019-09-02

299 downloads per month
Used in 3 crates (2 directly)

BSD-3-Clause

250KB
4.5K SLoC

bcder – BER, CER, and DER Encoding and Decoding for Rust

This crate provides decoding and encoding for Basic Encoding Rules (BER) of the ASN.1 standard as well as the more strict variants Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER). It provides the basic machinery as well as implementation for the most important universal types of ASN.1.

Usage

Add the following dependency to your Cargo.toml:

[dependencies]
bcder = "^0.1"

A guide introducing ASN.1, BER, and how to use this crate is part of the source as the [ber::guide] module.

Contributing

If you have comments, proposed changes, or would like to contribute, please open an issue.

License

bcder is distributed under the terms of the BSD-3-clause license. See LICENSE for details.


lib.rs:

Handling of data in Basic Encoding Rules.

This crate allows decoding and encoding of data encoded in ASN.1’s Basic Encoding Rules as defined in ITU recommendation X.690 as well as their stricter companions Cannonical Encoding Rules and Distringuished Encoding Rules.

You will find a short introduction to ASN.1 and encoding rules as well as a discussion of how decoding and encoding with the crate work in the guide module. The documentation with all the other modules serves as a reference documentation.

The most important modules of the crate are decode and encode that provide the machinery for implementing decoding and encoding of data.

Additionally, the crate provides a number of types that help dealing with the more difficult universal types in ASN.1. Specifically, the module int provides variable length integers, the module string contains types for the various kinds of strings defined in ASN.1, and oid deals with object identifiers. Finally, Captured provides a way to keep encoded data around for later processing.

Dependencies

~270–405KB