asn1-rs
Parser/encoder for ASN.1 BER/DER data
0.7.2
142M downloads/mo
#637 most downloaded on crates.io
rusticata/asn1-rs
What this package is like to depend on
Last release 3 months ago
18 May 2026
Release timing varies
gaps range from 2 weeks to 13 months
Most releases are documented
notes for 12 of 16 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
18 releases · first in 2021
2 releases in the last 12 months
see the full history below
Release timeline
18 releases · Jul 2021 to May 2026Releases
latest 18-
0.8.0-beta.218 May 2026 pre-release -
0.8.0-beta.114 Apr 2025 pre-release -
0.7.218 May 2026Release notes
Open source →Changed/Fixed
- Fix potential denial of service when
REALfromNaN
Encoding of "Real" type does not handle NaN (Not a Number) special case, and attempting to call
Real::new(f64::NaN)will:- on a release build, enter an infinite loop (due to an underflow in exponent encoding)
- on a debug build, trigger a panic
This is considered as low-severity.
Thanks to Domen Puncer Kugler [email protected] for the report.
-
Bump dependency on time, and update Cargo.lock to use 0.3.47 Previous versions of
timeare affected by 'RUSTSEC-2026-0009' and causecargo auditto failNote: features from this advisory are not used in
asn1-rs, which is not affected. This changed is only required because it causes failures in CI runs of dependant software.As a side-effect,
timerequires an update of the MSRV, which is now 1.68
- Fix potential denial of service when
-
0.7.117 Mar 2025Release notes
Open source →Changed/Fixed
- Update lock file
- Update features trace and debug to depend on std (#70)
- Fix doctests with
--no-default-features - Make some tests conditional if
stdis not enabled - Fix misc clippy (nightly) warnings
-
0.7.016 Jan 2025Release notes
Open source →What's Changed
- Fix receiver lifetimes in
Anymethods. by @SergioBenitez in #22 - TaggedImplicit: Fix construction bit inherent by @chessnokov in #18
- Updates license field to valid SPDX format by @ibeckermayer in #34
- Add debug/trace features by @chifflier in #35
- ci: add github-actions ecosystem to dependabot by @cpu in #36
- Add licenses to crates by @wojnilowicz in #38
- Update cargo-check-external-types rustc version by @cpu in #41
- Fix encoding of optional TaggedImplicit object by @yestyle in #42
- Bump rustsec/audit-check from 1 to 2 by @dependabot in #45
- Update thiserror requirement from 1.0.25 to 2.0.0 by @dependabot in #46
- Asn1 rs derive tostatic by @chifflier in #47
- Asn1 rs update nostd by @chifflier in #60
- Bump colored from 2.1.0 to 3.0.0 by @dependabot in #57
- Asn1 rs derive toder by @chifflier in #61
New Contributors
- @SergioBenitez made their first contribution in #22
- @chessnokov made their first contribution in #18
- @ibeckermayer made their first contribution in #34
- @cpu made their first contribution in #36
- @wojnilowicz made their first contribution in #38
- @yestyle made their first contribution in #42
- @dependabot made their first contribution in #45
Full Changelog: asn1-rs-0.5.2...asn1-rs-0.7.0
Release notes
Open source →Changed/Fixed
- Update
thiserrorto 2.0 and deriveErrorfor error types (even withno_std)
Added
- Add
ToStaticcustom derive attribute - Add
ToDerSequencecustom derive attribute (#44)
- Fix receiver lifetimes in
-
0.6.231 Jul 2024Release notes
Open source →Changed/Fixed
Important:
- Fix a potential panic when using derived parsers, when using custom errors (see #40) This affects only auto-derived parsers specifying a custom error, and parsing incomplete data.
Fixed:
- Fix wrong encoding of large tags (#43)
- Fix wrong encoding of optional TaggedImplicit object (#42)
General:
- Add licences to sub-crates (#38)
- Refactor CI (#36, #41)
- Updates license field to valid SPDX format (#34)
Thanks
- Daniel McCarney, Łukasz Wojniłowicz, Isaiah Becker-Mayer, Philip Ye
-
0.6.127 Feb 2024 -
0.6.023 Feb 2024Release notes
Open source →Changed/Fixed
General:
- Set MSRV to 1.67.0
- Add PartialEq to SequenceOf and SetOf
- Implement traits for SequenceOf and SetOf to improve usability
- Fix receiver lifetimes in
Anymethods - Implement
BmpString::try_fromfor &Any (so it does not need to consume input) (#26) - oid: change macro to expect dot-separated literals (#28)
- Fix wrong tag in encoding of SET OF (#30)
- Option: require T::Tagged, and check tag before constraints (#27)
- Add missing constructed bit when serializing [2] IMPLICIT) (#18)
- Add methods to convert Any to Real
- Add tag for CHARACTER STRING (29)
- Fix method
Any::as_generalstring(wrong return type) - Add method
Any::as_bmpstring - Fix clippy warnings (1.76.0)
Dependencies updates:
- pem to 3.0
- hex-literal to 0.4
- syn to 2.0
- examples: drop circular dev-dependency caused by oid-registry
Thanks
- Sergio Benitez, Andrey Chesnokov
-
0.5.207 Mar 2023Release notes
Open source →What's Changed
- Fix decoding of integers: check if value will wrap if integer is signed
- Fix encoding of integers (add 0x00 prefix when required, and remove extra 0xff for negative integers)
- Fix a small math error in GeneralizedTime
- Introduce trait GetObjectContent, use
from_berwhen skipping BER content (closes #14)
New Contributors
Full Changelog: asn1-rs-0.5.1...asn1-rs-0.5.2
Release notes
Open source →Changed/Fixed
- Fix decoding of integers: check if value will wrap if integer is signed
- Fix encoding of integers (add 0x00 prefix when required, and remove extra 0xff for negative integers)
- Fix a small math error in GeneralizedTime
- Introduce trait GetObjectContent, use
from_berwhen skipping BER content (closes #14)
Thanks
- Nadja Reitzenstein, Christian Speich
-
0.5.120 Jun 2022Release notes
Open source →Minor fixes:
- Fix constraints too strict on
TaggedValue::FromDer, do not auto-derive - Update oid-registry
- Fix
Any::as_relative_oidto take a reference (and not consume input)
derive:
- Add special case handler for alias to Any
- Add support for DEFAULT attribute
Release notes
Open source →Minor fixes:
- Fix constraints too strict on
TaggedValue::FromDer, do not auto-derive - Update oid-registry
- Fix
Any::as_relative_oidto take a reference (and not consume input)
derive:
- Add special case handler for alias to Any
- Add support for DEFAULT attribute
- Fix constraints too strict on
-
0.5.024 May 2022Release notes
Open source →This release adds some new methods and custom derive attributes. It also adds a lot of tests to improve code coverage.
asn1-rs:
- Add helper types for Application/Private tagged values
- Any: add methods
from_ber_and_then(and_der) - TaggedParser: add documentation for
from_ber_and_then(and_der) - Oid: add method
starts_with - Fix documentation of application and private tagged helpers
- Fix clippy warnings
derive:
- Add custom derive BerAlias and DerAlias
coverage:
- Add many tests to improve coverage
-
0.4.208 May 2022Release notes
Open source →Bugfix release:
- Remove explicit output lifetime in traits
- Fix wrong encoding
BmpStringwhen usingToDer - Fix parsing of some EmbeddedPdv subtypes
- Fix encoded length for Enumerated
- Add missing
DerAutoDeriveimpl for bool - Add missing
DerAutoDeriveimpl for f32/f64 - Remove redundant check,
Any::from_derchecks than length is definite - Length: fix potential bug when adding Length + Indefinite
- Fix inverted logic in
Header::assert_definite()
-
0.4.111 Apr 2022 -
0.4.011 Apr 2022Release notes
Open source →asn1-rs:
- Add generic error parameter in traits and in types
- This was added for all types except a few (like
Vec<T>orBTreeSet<T>) due to Rust compiler limitations
- This was added for all types except a few (like
- Add
DerAutoDerivetrait to control manual/automatic implementation ofFromDer- This allow controlling automatic trait implementation, and providing manual
implementations of both
FromDerandCheckDerConstraints
- This allow controlling automatic trait implementation, and providing manual
implementations of both
- UtcTime: Introduce utc_adjusted_date() to map 2 chars years date to 20/21 centuries date (#9)
derive:
- Add attributes to simplify deriving EXPLICIT, IMPLICIT and OPTIONAL
- Add support for different tag classes (like APPLICATION or PRIVATE)
- Add support for custom errors and mapping errors
- Add support for deriving BER/DER SET
- DerDerive: derive both CheckDerConstraints and FromDer
documentation:
- Add doc modules for recipes and for custom derive attributes
- Add note on trailing bytes being ignored in sequence
- Improve documentation for notation with braces in TaggedValue
- Improve documentation
- Add generic error parameter in traits and in types
-
0.3.109 Feb 2022Nothing published for this version
-
0.3.031 Jan 2022Nothing published for this version
-
0.2.020 Jul 2021Nothing published for this version
-
0.1.006 Jul 2021Nothing published for this version