The major changes in version 0.19 are described here.
Dependencies:
nomupdated to 8.0asn1-rsupdated to 0.8- note that
bigintis enabled inasn1-rsimport bitvecis present by default
- note that
der-parserdependency (and re-export) removed
- The default parsing trait is now
DerParser. The parsing function.parse_der()now expects anInputobject, which can be built from bytes usingInput::from. All X.509 objects and sub-objects will provide this trait- This improves error handling (
Inputtracks offsets) and helps simplifying code for parsers
- This improves error handling (
- The legacy trait
FromDeris still provided for compatibility, for top-level objects.
General:
UniqueIdentifierhas no lifetime anymore- Removed constant
MAX_OBJECT_SIZE. This is not required in this crate sinceasn1-rstakes care of reading valid data. - Module
utils.rshas been removed, functions are now part ofx509.rs
CSR:
X509CertificationRequestextensions contains a SET of values, not a single valuecsr.requested_extensions()returns anIterator, not anOption<Iterator>
Extensions:
InhibitAnyPolicyis now an anonymous struct:InhibitAnyPolicy { skip_certs: 2 }=>InhibitAnyPolicy(2)SubjectAlternativeNameiteration changed from&san.general_namestosan.general_names()(or.0)
The following changes are not part of this crate, but are exposed in Any objects:
- Any.data() now has type
Input- Use
.as_bytes2()to get&[u8]- Note: recoding
.as_bytes()or.as_ref()may seem useless, but this is necessary to work around problem with lifetimes.
- Note: recoding
- Use
BitStringdoes not have a lifetime parameter anymorebitstring.datais replaced bybitstring.as_raw_slice()
- The nom
Parsertrait has changed (it now uses associated types) - Add
.parse, for ex:length_data(be_u16).parse(i)
- Many parsers have been replaced by derive attributes (like
SequenceorChoice) when possible. This reduces risks of errors and makes code more easier to maintain- Encoders are not derived for now
- File
extensions/mod.rshas been split in multiple files