structured-asn1
A BER/DER reader that borrows encoded values and retains their original byte ranges. Nested readers share depth, element, length and work limits. Resource exhaustion is distinct from malformed input.
OID identity uses its encoded bytes. Oid::text(&Memory) and
Arc::text(&Memory) materialize exact decimal text with fallible work and
capacity admission. Returned text retains its storage charge until released;
OID and arc values do not implement Display. Borrowed arc iteration leaves
its traversal admission to the caller.
Owned vectors, maps and strings retain allocated capacity on their original
resource account. Container construction, growth and copies operate in that
declared domain. Map lookup/removal and try_iter(&Memory) may instead use a
current execution account; iteration prepays control buckets, including sparse
holes. Rebuilding a collection in another domain requires an explicit fallible
copy; retained allocations are never silently rebound.
This crate reads encoding structure, not certificate trust or signature validity.
It uses no_std + alloc by default and has no cryptographic backend or I/O.
extern crate alloc;
use Arc;
use ;
use ;
let bytes = ;
let memory = new;
let parser = der;
let mut reader = parser.read?;
let sequence = reader.expect?;
let mut inside = reader.enter?;
let integer = inside.expect?;
assert_eq!;
# Ok::
Licensed under Apache-2.0.