encoding-asn1 0.1.0

asn1 crate based on pkg.go.dev/encoding/asn1
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use encoding_asn1::unmarshal::Error;
use encoding_asn1::{
    common, parse_tag_and_length, unmarshal, unmarshal_with_params, Unmarshal, Unmarshaler,
};

#[derive(Debug, Unmarshal)]
struct IntStruct {
    a: i32,
}

fn main() {
    let bytes = vec![0x30, 0x03, 0x02, 0x01, 0x40];
    let b = unmarshal::<IntStruct>(&bytes);
    println!("b: {:?}", b);
}