$ yasna

v0.6.0MAJOR UPDATE

ASN.1 library for Rust

Downloads: 52.6M
Recent: 14.6M
Versions: 15
Updated: March 14, 2026

Latest Update Summary

Crate

Name: yasna New version: 0.6.0 Release date: 2026-03-14T04:29:57.441431Z

Crate readme

Short description ASN.1 library for Rust

Long description This is a Rust library for reading and writing ASN.1 data. It supports serialization in DER and BER. The minimum supported Rust version (MSRV) of yasna.rs is Rust 1.60.0. Optional feature flags enable interoperability with third-party crates.

Features • Serialization in DER • Deserialization in BER and DER • Supports BOOLEAN, INTEGER, BITSTRING, OCTETSTRING, NULL, OBJECT IDENTIFIER, SEQUENCE, SEQUENCE OF, SET, SET OF, CHOICE

Code Examples Serialization example

 fn main() {
    let der = yasna::construct_der(|writer| {
        writer.write_sequence(|writer| {
            writer.next().write_i64(10);
            writer.next().write_bool(true);
            return Ok(());
        })
    });
    println!("(10, true) = {:?}

Deserialization example

 fn main() {
    let asn = yasna::parse_der(&[48, 6, 2, 1, 10, 1, 1, 255], |reader| {
        reader.read_sequence(|reader| {
            let i = reader.next().read_i64()?;
            let b = reader.next().read_bool()?;
            return Ok((i, b));
        })
    }).unwrap();
    println!("{:?} = [48, 6, 2, 1, 10, 1, 1, 255]", asn);
}

Linkshttps://crates.io/crates/yasnahttps://qnighy.github.io/yasna.rs/yasna/index.html

https://docs.rs/yasna

Release info

Release version: N/A

Release description N/A

Code Examples N/A

Minor update: 0.5.2 → 0.6.0

$ DOWNLOADS TREND

32.6M52.6M

$ VERSION HISTORY

v0.6.0March 14, 2026
v0.5.2April 6, 2023

$ LINKS

$ INSTALL

cargo add yasna

Or add to Cargo.toml: yasna = "0.6.0"