Function yasna::decode_ber[][src]

pub fn decode_ber<T: BERDecodable>(src: &[u8]) -> ASN1Result<T>

Reads an ASN.1 value from &[u8].

If you want to accept only DER-encoded data, use decode_der.

Examples

use yasna;
let asn : i64 = yasna::decode_ber(&[2, 3, 0, 255, 255]).unwrap();
assert_eq!(asn, 65535);