$ yasna
v0.6.0MAJOR UPDATEASN.1 library for Rust
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);
}
Links • https://crates.io/crates/yasna • https://qnighy.github.io/yasna.rs/yasna/index.html
Release info
Release version: N/A
Release description N/A
Code Examples N/A
Minor update: 0.5.2 → 0.6.0
$ DOWNLOADS TREND
$ VERSION HISTORY
$ LINKS
$ INSTALL
cargo add yasnaOr add to Cargo.toml: yasna = "0.6.0"