bcder
Handling of data encoded in BER, CER, and DER.
0.7.7
23M downloads/mo
#1945 most downloaded on crates.io
nlnetlabs/bcder
What this package is like to depend on
Last release 2 months ago
08 Jun 2026
Ships fairly regularly
a new release about every 8 months
Nearly every release is documented
notes for 20 of 21 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
21 releases · first in 2018
2 releases in the last 12 months
see the full history below
Release timeline
21 releases · Oct 2018 to Jun 2026Releases
latest 21-
0.7.708 Jun 2026Release notes
Open source →New
- Added
RestrictedString::take_opt_from. (#90)
Improvements
BIT_STRINGparsing now checks that the unused bits are zero in CER and DER modes. (#97)
Bug fixes
- Fixed
Utf8Stringpotentially accepting invalid UTF-8. (#91 by @sumleo) - Fixed a panic in
Unsigned::from_byteswhen the input is all zero. (#92 by @sumleo) - Fixed incorrect bounds check in
BitString::bit. (#93 by @sumleo) - Added character set validation to
FromStrimpl forNumericString,PrintableString, andIa5String. (#95 by @sumleo)
Release notes
Open source →Released 2026-06-08.
New
- Added
RestrictedString::take_opt_from. (#90)
Improvements
BIT_STRINGparsing now checks that the unused bits are zero in CER and DER modes. (#97)
Bug fixes
- Fixed
Utf8Stringpotentially accepting invalid UTF-8. (#91 by @sumleo) - Fixed a panic in
Unsigned::from_byteswhen the input is all zero. (#92 by @sumleo) - Fixed incorrect bounds check in
BitString::bit. (#93 by @sumleo) - Added character set validation to
FromStrimpl forNumericString,PrintableString, andIa5String. (#95 by @sumleo)
- Added
-
0.7.616 Sep 2025Release notes
Open source →New
- Addded
BitString::octetwhich lets you fetch the octet with the given index. (#88)
Release notes
Open source →Released 2025-09-16.
New
- Addded
BitString::octetwhich lets you fetch the octet with the given index. (#88)
- Addded
-
0.7.522 Jan 2025Release notes
Open source → -
0.7.410 Jan 2024Release notes
Open source →Other changes
- Update smallvec dependency to at least 1.6.1 due to a security advisory RUSTSEC-2021-0003. (#77)
Release notes
Open source →Released 2024-01-10.
Other changes
- Update smallvec dependency to at least 1.6.1 due to a security advisory RUSTSEC-2021-0003. (#77)
-
0.7.313 Sep 2023Release notes
Open source →This release fixes a number of decoding issues that can lead to panics on invalid input data. They have been assigned CVE-2023-39914.
Bug fixes
- Fixes various decoding that lead to a panic on invalid data.
Specifically:- error out rather than panic when a nested value has a greater length than allowed by the outer value,
- check that there is enough data available before skipping over a primitive value’s content,
- check that enough data is available before trying to parse a tag value,
- check for correct encoding of bit strings: don’t allow the number of unused bits to be greater than 7 and that they are zero for an empty bit string,
- check for correct encoding of object identifiers: they cannot be empty and the last byte must have bit 7 cleared.
Release notes
Open source →Release 2023-09-13.
This release fixes a number of decoding issues that can lead to panics on invalid input data. They have been assigned CVE-2023-39914.
Bug fixes
- Fixes various decoding that lead to a panic on invalid data.
Specifically:
- error out rather than panic when a nested value has a greater length than allowed by the outer value,
- check that there is enough data available before skipping over a primitive value’s content,
- check that enough data is available before trying to parse a tag value,
- check for correct encoding of bit strings: don’t allow the number of unused bits to be greater than 7 and that they are zero for an empty bit string,
- check for correct encoding of object identifiers: they cannot be empty and the last byte must have bit 7 cleared.
- Fixes various decoding that lead to a panic on invalid data.
-
0.7.201 Jun 2023Release notes
Open source → -
0.7.109 Dec 2022Release notes
Open source →New
- Added a number of missing well-defined tags as
Tagconstants, specifically:CHARACTER STRING,TIME,DATA,TIME_OF_DAY,DATE_TIME,DURATION,OID-IRI, andRELATIVE-OID-IRI. (#67 by @lvkv)
Bug fixes
Release notes
Open source →Released 2022-12-09.
New
- Added a number of missing well-defined tags as
Tagconstants, specifically:CHARACTER STRING,TIME,DATA,TIME_OF_DAY,DATE_TIME,DURATION,OID-IRI, andRELATIVE-OID-IRI. (#67 by @lvkv)
Bug fixes
- Added a number of missing well-defined tags as
-
0.7.018 Jul 2022Release notes
Open source →Breaking Changes
- Redesign error handling in
decodemodule (#65):- three error types,
Source::Error,ContentError, andDecodeError, for data fetching errors, syntax errors, and a combination of these,
respectively; - new trait
IntoSourceto convert a type into itsSourceimplementation; Source::advancenow panics if advancing past the end of seen data.
- three error types,
Release notes
Open source →Released 2022-07-18.
Breaking Changes
- Redesign error handling in
decodemodule (#65):- three error types,
Source::Error,ContentError, andDecodeError, for data fetching errors, syntax errors, and a combination of these, respectively; - new trait
IntoSourceto convert a type into itsSourceimplementation; Source::advancenow panics if advancing past the end of seen data.
- three error types,
- Redesign error handling in
-
0.6.129 Oct 2021 -
0.6.004 Jan 2021Release notes
Open source → -
0.5.104 Jan 2021Release notes
Open source → -
0.5.005 Mar 2020Release notes
Open source →Breaking
- Move extending a
Capturedto an explicitCapturedBuilder. This becomes necessary with bytes 0.5. Both these types now reside in the modulecapturedwithCapturedre-exported at crate level. (#46, #47)
Dependencies
- Upgrade bytes to 0.5. (#43, thanks to @Fabian-Gruenbichler)
- Upgrade smallvec to 1.1. (#48)
- Move extending a
-
0.4.211 Feb 2020Release notes
Open source →Bug Fixes
- Fix handling of incomplete multi-byte tags. (#44, based on #41 by @dovreshef)
-
0.4.103 Dec 2019Release notes
Open source →New
- Support for multi-byte tags with tag numbers of up to
0x1F_FFFF. (#37, thanks to by @dovreshef)
Bug Fixes
- Fix encoding of signed builtin integer (
i8,i16, …). (#39)
- Support for multi-byte tags with tag numbers of up to
-
0.4.009 Sep 2019Release notes
Open source →Breaking
- Dropped
RestrictedString::to_stringand implemented it viaDisplayinstead. Therefore, you will have touse std::fmt::Displayto get it back. (#33)
Bug Fixes
- Safely decode deeply nested BER such as octet strings. Decoding such types now uses an allocated artificial stack and will thus not overflow the regular one. (#30)
Miscellaneous
- Dropped
-
0.3.108 Jul 2019 -
0.3.031 May 2019Release notes
Open source →Breaking
- The minimum supported Rust version is now 1.34.0. (#22)
New
- New methods for checking the class and number on
Tag. (#20) - Implement
TryFromfor builtin integers andIntegerandUnsigned. (#23) RestrictedString::into_bytes(#24)
Other Changes
- The
xerr!macro now prints a backtrace with theextra-debugfeature enabled instead of panicking. (#21)
-
0.2.209 Sep 2019Nothing published for this version
-
0.2.106 Mar 2019 -
0.2.014 Feb 2019Release notes
Open source →Breaking Changes
-
Drop use of failure crate. Error types now provide a
Displayimplementation only. [(#15)] -
PrimitiveContent’s methods takeselfinstead of&self. This avoids the lifetime argument inPrimitive, its encoder. (#7) -
For all provided type, change
encodeandencode_asmethods to take self by value and introduceencode_refandencode_ref_asthat take self by reference. (#12) -
RestrictedString::from_strreplaced by an implementation of theFromStrtrait. (#13)
New
-
encode::Valuesimplemented for tuples of up to twelve elements. (#9) -
OctetString::encode_sliceandencode_slice_as: allows encoding a bytes slice as an octet string without going through making anOctetStringfirst. -
encode::Slicewraps a slice of values encodingencode::Valuesand provides an encoder for it. (#11) -
new functions:
encode::sliceandencode::iteras shortcuts for the respective associated functions. (#11)
-
-
0.1.023 Oct 2018