PackageTrack
Sign in Get early access

der-parser

Parser/encoder for ASN.1 BER/DER data

10.0.0 146M downloads/mo #622 most downloaded on crates.io rusticata/der-parser

What this package is like to depend on

Last release 2 years ago

no release in 18 months

Release timing varies

gaps range from 2 weeks to 11 months

Most releases are documented

notes for 35 of 51 stable releases

3 versions withdrawn

withdrawn after publishing

9 years old

60 releases · first in 2017

0 releases in the last 12 months

see the full history below

Release timeline

60 releases · Mar 2017 to Jan 2025
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 60
  1. 10.0.0 21 Jan 2025
    Release notes

    Changed/Fixed

    Breaking change:

    • BerObject: convert BmpString data to &[u8] to properly handle UTF-16 data (#76)

    • Upgrade asn1-rs to 0.7.0

    • Rename feature "bitvec" to "as_bitvec" and update to bitvec 1.0 (#73)

    • Serialize: fix possible wrong encoding of length if exactly 128 (#77)

    Thanks

    • Daniel McCarney
    Open source →
  2. 9.0.0 23 Feb 2024
    Release notes

    Changed/Fixed

    • Upgrade asn1-rs to 0.6.0
    • Set MSRV to 1.63.0
    • Update hex-literal to 0.4.0
    • Implement BerObject::try_from(Any) (#67)
    Open source →
  3. 8.2.0 07 Mar 2023
    Release notes

    What's Changed

    • Fix parser name to parse_der_visiblestring for VisibleString (Closes #64).
      Keep previous function for compatibility (mark it as deprecated).
    • Fix clippy warnings (rustc 1.67.1)
    • Update test-case from 2.0 to 3.0

    Full Changelog: der-parser-8.1.0...der-parser-8.2.0

    Open source →
    Release notes

    Changed/Fixed

    • Fix parser name to parse_der_visiblestring for VisibleString (Closes #64). Keep previous function for compatibility (mark it as deprecated).
    • Fix clippy warnings (rustc 1.67.1)
    • Update test-case from 2.0 to 3.0
    Open source →
  4. 8.1.0 24 May 2022
    Release notes

    Changed/Fixed

    • Upgrade asn1-rs to 0.5.0 (new features only: only increment minor number)
    Open source →
  5. 8.0.0 11 Apr 2022
    Release notes

    Changed/Fixed

    • Upgrade asn1-rs to 0.4.0 This causes an increment of the major number, because asn1-rs is re-exported
    Open source →
  6. 7.0.0 10 Feb 2022
    Release notes

    This release marks the beginning of the merge with the asn1-rs crate. This will break things.

    However, this is necessary, because the asn1-rs crate is much cleaner and supports more types
    and features (like serialization, custom derive, etc.).
    Ultimately, this crate will become a frontend to asn1-rs, that will be optional: crate users can
    switch to asn1-rs and use it directly.

    Changed/Fixed

    MSRV: The minimum supported rust version is now 1.53.

    BerObjectHeader:

    • BerSize has been renamed to Length
    • BerClass has been renamed to Class
    • BerTag has been renamed to Tag
    • Header fields are now private. Getters/setters have been added, and must be used to access/modify fields

    BerObjectContent:

    • Unknown variant now contains an Any object, with both the header and object content
    • Private variant has been merged into Unknown
    • BmpString, GeneralString, GraphicString, T61String, VideotexString and ObjectDescriptor are now decoded
    • GeneralizedTime and UtcTime are now decoded

    BerError:

    • Add error types UnexpectedClass and UnexpectedTag
    • Store expected and found item in error to help debugging
    • Keep InvalidTag for tags with invalid form (length/encoding/etc.)
    • Use displaydoc for BerError
    • Parsing an indefinite length in DER now raises IndefiniteLengthUnexpected
    • Error: when a DER constraint fails, store constraint identifier

    DER:

    • DerClass and DerTag have been deprecated. Use Class and Tag instead.
    • DerObjectHeader has been deprecated. Use Header instead.

    Oid:

    • The Oid object is now the same as asn1_rs::Oid (simply reexported)
    • Remove dependency on crate der-oid-macro

    Misc:

    • ber_read_element_content_as now requires a non-zero depth, or it
      will raise a BerMaxDepth error (previously, 0 allowed one level of parsing)
    • crate rusticata-macros is now re-exported (#55)

    Thanks

    Full Changelog: https://github.com/rusticata/der-parser/commits/der-parser-7.0.0

    Open source →
    Release notes

    This release marks the beginning of the merge with the asn1-rs crate. This will break things.

    However, this is necessary, because the asn1-rs crate is much cleaner and supports more types and features (like serialization, custom derive, etc.). Ultimately, this crate will become a frontend to asn1-rs, that will be optional: crate users can switch to asn1-rs and use it directly.

    Changed/Fixed

    MSRV: The minimum supported rust version is now 1.53.

    BerObjectHeader:

    • BerSize has been renamed to Length
    • BerClass has been renamed to Class
    • BerTag has been renamed to Tag
    • Header fields are now private. Getters/setters have been added, and must be used to access/modify fields

    BerObjectContent:

    • Unknown variant now contains an Any object, with both the header and object content
    • Private variant has been merged into Unknown
    • BmpString, GeneralString, GraphicString, T61String, VideotexString and ObjectDescriptor are now decoded
    • GeneralizedTime and UtcTime are now decoded

    BerError:

    • Add error types UnexpectedClass and UnexpectedTag
    • Store expected and found item in error to help debugging
    • Keep InvalidTag for tags with invalid form (length/encoding/etc.)
    • Use displaydoc for BerError
    • Parsing an indefinite length in DER now raises IndefiniteLengthUnexpected
    • Error: when a DER constraint fails, store constraint identifier

    DER:

    • DerClass and DerTag have been deprecated. Use Class and Tag instead.
    • DerObjectHeader has been deprecated. Use Header instead.

    Oid:

    • The Oid object is now the same as asn1_rs::Oid (simply reexported)
    • Remove dependency on crate der-oid-macro

    Misc:

    • ber_read_element_content_as now requires a non-zero depth, or it will raise a BerMaxDepth error (previously, 0 allowed one level of parsing)
    • crate rusticata-macros is now re-exported (#55)

    Thanks

    • @lilyball
    • @erikmarkmartin
    Open source →
  7. 6.0.1 27 Jan 2022
    Release notes

    What's Changed

    • Report number of missing bytes when having a complete header and incomplete data

    Full Changelog: https://github.com/rusticata/der-parser/commits/der-parser-6.0.1

    Open source →
  8. 6.0.0 13 Sep 2021
    Release notes

    This release has several major changes:

    • upgrade to nom 7
    • add support for no_std
    • remove all macros
    • update MSRV to 1.48

    Changed/Fixed

    • Do not attempt to parse PRIVATE object contents (closes #48)
    • BER: raise error if using Indefinite length and not constructed
    • Fix oid! macro to be independant of der_parser crate name and path (#46)
    • Simplify der-oid-macro, do not depend on nom
    • Fix INTEGER signed/unsigned parsing (#49)
    • Change as_bigint() and as_uint() to return a Result
    • Remove deprecated functions

    Added

    • Added support for no_std (#50)
    • Make BerError Copy + Clone (#51)
    • Add feature 'bitvec' for .as_bitslice() methods

    Removed

    • Remove all macros

    Thanks

    • @yoguorui for no_std support
    • @SergioBenitez for BerError traits
    • @lilyball for INTEGER parsing
    Open source →
  9. 6.0.0-beta1 06 Sep 2021 pre-release

    Nothing published for this version

  10. 5.1.2 03 Aug 2021

    Nothing published for this version

  11. 5.1.1 26 Jul 2021

    Nothing published for this version

  12. 5.1.0 25 Mar 2021
    Release notes

    Changed/Fixed

    • Remove dependency on proc-macro-hack (attempt to fix #36)
    • Update pretty_assertions requirement from 0.6 to 0.7
    • Update num-bigint to 0.4 (Closes #42)
    Open source →
  13. 5.0.1 08 Mar 2021
    Release notes

    Changed/Fixed

    • Fix typos in the parse_[ber|der]_[u32|u64] doc comments
    • Add documentation for BerObjectContent variants (#41)
    • Fixes for clippy

    Added

    Open source →
  14. 5.0.0 28 Nov 2020
    Release notes

    See changelog entries for 5.0.0-beta1 and -beta2 for changes since 4.1

    Changed/Fixed

    The following changes applies since 5.0.0-beta1, and do not affect 4.x

    • Fix potential integer underflow in bytes_to_u64
    • Fix potential stack recursion overflow for indefinite length objects (Add maximum depth).
    • Fix potential UB in bitstring_to_u64 with large input and many ignored bits
    • Fix constructed objects parsing with indefinite length (do not include EOC)
    • Constructed objects: use InvalidTag everywhere if tag is not expected
    • Integer parsing functions now all return IntegerTooLarge instead of MapRes
    • Ensure Indefinite length form is only used in BER constructed objects

    Added

    • Add new error StringInvalidCharset and update string parsing methods
    • Add methods parse_ber_slice and parse_der_slice to parse an expected Tag and get content as slice
    Open source →
  15. 5.0.0-beta2 24 Nov 2020 pre-release
    Release notes

    Changed/Fixed

    • Consistency: reorder arguments or function callbacks, always set input slice as first argument (parse_ber_sequence_defined_g, parse_ber_container, parse_ber_tagged_explicit_g, ...)
    • Make functions parse_ber_sequence_of_v and parse_ber_set_of_v accept generic error types

    Added

    • Add parse_ber_content2, owned version of parse_ber_content, which can directly be combined with parse_ber_tagged_implicit_g
    • Add methods to parse DER tagged values and containers (with constraints)
    Open source →
  16. 5.0.0-beta1 02 Nov 2020 pre-release
    Release notes

    Changed/Fixed

    • Upgrade to nom 6
    • Switch all parsers to function-based parsers
    • Change representation of size (new type BerSize) to support BER indefinite lengths
    • Rewrite BER/DER parsing macros to use functional parsing combinators
    • The constructed bit is now tested for explicit tagged structures
    • Some checks (for ex. tags in constructed objects) now return specific errors (InvalidTag) instead of generic errors (Verify)
    • Refactor BerObject for parsing of tagged and optional values
    • Add method as_bitslice() to BerObject
    • Remove Copy trait from BerObjectHeader, copy is non-trivial and should be explicit
    • Fix the bug that caused OIDs longer than two subidentifiers which started by subidentifiers "0.0" ("itu-t recommenation") not to be decoded correctly
    • Implement the as_u64 and as_u32 methods for BerObjects with contents of type BerObjectContent::BitString.
    • Implement the VideotexString, ObjectDescriptor GraphicString, and VisibleString string types. (Non-breaking changes)
    • Correctly decode BMPString as UTF-16 instead of UTF-8 when printing. (Non-breaking change)
    • Turn UTCTime and GeneralizedTime into a &str instead of &[u8], as they inherit from VisibleString which is a subset of ASCII. (Breaking change)

    Added

    • Add combinator parse_ber_optional

    Thanks

    By alphabetic order of handle:

    • @cccs-sadugas
    • @nickelc
    • @p1-mmr
    Open source →
  17. 4.1.1 13 Apr 2023

    Nothing published for this version

  18. 4.1.0 03 Sep 2020
    Release notes

    Added/Changed

    • Re-export num-bigint so crate users do not have to import it
    • Add function versions to parse BER sequences/sets (#20)
    • Add function versions to parse BER tagged objects (#20)
    • Add generic error type to structured parsing functions
    • Add function to parse a generic BER container object
    • Document that trailing bytes from SEQUENCE/SET are ignored
    • Deprecate functions parse_{ber,der}_explicit (use _optional)
    Open source →
  19. 4.0.2 08 Jul 2020
    Release notes

    Changed/Fixed

    • Upgrade dependencies on num-bigint and der-oid-macro
    Open source →
  20. 4.0.1 29 Jun 2020
    Release notes

    Changed/Fixed

    • Add workaround to fix parsing of empty sequence or set
    Open source →
  21. 4.0.0 05 Jun 2020
    Release notes

    Attention This is a major release, with several API-breaking changes. See UPGRADING.md for instructions.

    Thanks

    • Jannik Schürg (oid, string verifications)

    Added

    • Add functions parse_ber_recursive and parse_der_recursive, allowing to specify maximum recursion depth when parsing
    • The string types IA5String, NumericString, PrintableString and UTF8String do now only parse if the characters are valid.
    • as_str() was added to BerObjectContent to obtain a &str for the types above. as_slice() works as before.
    • Implement Error trait for BerError
    • Add method to extract raw tag from header
      • BerObjectHeader now has a lifetime and a raw_tag field
      • BerObject now has a raw_tag field
      • Implement PartialEq manually for BerObject: raw_tag is compared only if both fields provide it
    • Add type BerClass
    • Start adding serialization support (experimental) using the serialize feature

    Changed/Fixed

    • Make header part of BerObject, remove duplicate fields
    • Maximum recursion logic has changed. Instead of providing the current depth, the argument is now the maximum possible depth.
    • Change the api around Oid to achieve zero-copy. The following changed:
      • The Oid struct now has a lifetime and uses Cow internally.
      • The procedural macro oid! was added.
      • Oid::from returns a Result now.
      • The Oid struct now encodes whether the oid is relative or not.
      • The Debug implementation now shows whether the oid is relative and uses the bigint feature if available.
      • The Oid::iter method now returns an Option. Oid::iter_bigint was added.
      • Hash is now derived for Oid.
    • Minimum rust version is now 1.34
    Open source →
  22. 4.0.0-beta1 02 Jun 2020 pre-release

    Nothing published for this version

  23. 4.0.0-alpha3 09 Apr 2020 pre-release withdrawn

    Nothing published for this version

  24. 4.0.0-alpha2 31 Mar 2020 pre-release withdrawn

    Nothing published for this version

  25. 4.0.0-alpha1 18 Feb 2020 pre-release withdrawn

    Nothing published for this version

  26. 3.0.4 30 Jan 2020

    Nothing published for this version

  27. 3.0.3 26 Nov 2019
    Release notes
    • Make the pretty-printer function public
    • Fix DER datestring sanity check
    • CI
      • add rusfmt check
      • add cargo clippy
    Open source →
  28. 3.0.2 01 Sep 2019
    Release notes
    • Add parse_ber_u32 and parse_ber_u64 functions
    • Fix typo in description
    Open source →
  29. 3.0.1 21 Aug 2019
    Release notes
    • Add crate BerResult and DerResult types
    • Use crate result types, remove uneeded imports
      • Crates using der-parser do not need to import nom or rusticata-macros anymore
      • Result types are aliases, so API is unchanged
    Open source →
  30. 3.0.0 05 Aug 2019
    Release notes
    • Upgrade to nom 5 (breaks API)
    • New error types, now all functions use BerError
    Open source →
  31. 2.1.0 25 Jul 2019
    Release notes
    • Handle BER/DER tags that are longer than one byte.
    • Set edition to 2018
    Open source →
  32. 2.0.2 25 Jul 2019
    Release notes
    • Revert 2.0.1 release, breaks API
    Open source →
  33. 2.0.1 25 Jul 2019
    Release notes
    • Handle BER/DER tags that are longer than one byte.
    Open source →
  34. 2.0.0 08 Jul 2019
    Release notes
    • Refactor code, split BER and DER, check DER constraints
    • Add recursion limit for sequences and sets
    • Rustfmt
    • Documentation
    • Remove unused function ber_read_element_content
    Open source →
  35. 2.0.0-alpha2 03 Jul 2019 pre-release

    Nothing published for this version

  36. 2.0.0-alpha1 18 Jun 2019 pre-release

    Nothing published for this version

  37. 1.1.1 24 Dec 2018
    Release notes
    • Fix OID parsing, and add support for relative OIDs
    • Add FromStr trait for Oid
    Open source →
  38. 1.1.0 22 Oct 2018
    Release notes
    • Use num-bigint over num and upgrade to 0.2
    Open source →
  39. 1.0.0 14 Aug 2018
    Release notes
    • Upgrade to nom 4
    Open source →
  40. 0.5.5 07 May 2018
    Release notes
    • Add functions parse_der_u32 and parse_der_u64 to quickly parse integers
    • Remove Oid::from_vec, Oid::from does the same
    • Enforce constraints on DER booleans
    Open source →
  41. 0.5.4 11 Apr 2018
    Release notes
    • Add BitStringObject to wrap BitString objects
    • Mark constructed BitStrings as unsupported
    • Do not try to parse application-specific data in parse_der
    Open source →
  42. 0.5.3 21 Mar 2018
    Release notes
    • Add function DerObject::as_u64
    • Add function DerObject::as_oid_val
    • Add parse_der_struct! variant to check tag
    Open source →
  43. 0.5.2 13 Mar 2018
    Release notes
    • Add functions to test object class and primitive/constructed state
    • Add macro parse_der_application!
    • Add macro parse_der_tagged! to parse [x] EXPLICIT or [x] IMPLICIT tagged values
    Open source →
  44. 0.5.1 02 Mar 2018
    Release notes
    • Add type GeneralString
    • Add macro parse_der_struct!
    Open source →
  45. 0.5.0 17 Jan 2018
    Release notes
    • Allow use of crate without extra use statements
    • Use constants for u32 errors instead of magical numbers
    • Rename tag_of_der_content() to DerObjectContent::tag
    • Rename DerElementxxx structs to have a consistent naming scheme
    • Add documentation for parsing DER sequences and sets, and fix wrong return type for sets
    • Fix a lot of clippy warnings
    • QA: add pragma rules (disable unsafe code, unstable features etc.)
    • More documentation
    • Switch license to MIT + APLv2
    Open source →
  46. 0.4.4 19 Oct 2017
    Release notes
    • Add macro parse_der_defined_m, to parse a defined sequence or set This macro differs from parse_der_defined because it allows using macros
    • Rename DerObject::new_int to DerObject::from_int_slice
    • Rename Oid::to_hex to Oid::to_string
    • Document more functions
    Open source →
  47. 0.4.3 16 Oct 2017

    Nothing published for this version

  48. 0.4.2 24 Sep 2017

    Nothing published for this version

  49. 0.4.1 11 Sep 2017
    Release notes
    • Add new feature 'bigint' to export DER integers
    • OID is now a specific type
    • Add new types T61String and BmpString
    • Fix wrong expected tag in parse_der_set_of
    Open source →
  50. 0.4.0 20 Jun 2017
    Release notes
    • Der Integers are now represented as slices (byte arrays) since they can be larger than u64.
    Open source →
  51. 0.3.5 07 Apr 2017

    Nothing published for this version

  52. 0.3.4 02 Apr 2017

    Nothing published for this version

  53. 0.3.3 27 Mar 2017

    Nothing published for this version

  54. 0.3.2 24 Mar 2017

    Nothing published for this version

  55. 0.3.1 06 Mar 2017

    Nothing published for this version

  56. 0.3.0 06 Mar 2017

    Nothing published for this version

  57. 0.2.0 03 Mar 2017

    Nothing published for this version

  58. 0.1.4 02 Mar 2017

    Nothing published for this version

  59. 0.1.3 02 Mar 2017

    Nothing published for this version

  60. 0.1.2 02 Mar 2017

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive