Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for offering to review the PR @djc
I expect you will want me to make some changes but wanted to talk about them before blindly trying to anticipate everything.
In #355 was some good justification for avoiding trait impls. Unfortunately I didn't see this until after I was almost done. I assume this concerns both
x509_parserandyasna. Would you like me toThere are some cases where I felt that there wasn't a fitting error case. I added an
Othercase as a temporary measure. They could probably be collectively classified asUserError(String)or are entirely unnecessary if it is not the libraries responsibility to enforce valid usage. Once example for these cases would be that any given Certificate Policy OID may only appear once per certificate.I also added comments about my thoughts and doubts during dev.
You requested some basic tests but I don't really know how I would do that from within the library. Serializing and deserializing the structs I just added doesn't really guarantee conformity and compatibility with external tools that are going to work with the output. So far my test was the newly added example and inspection of the output with
openssl.Adds the following extensions
This PR handles two of the extensions listed/requested in #370
In the following I just pasted the notes I took while I was trying to implement the extensions.
Requested Screenshots
OpenSSL (WSL)
cd certsopenssl x509 --in cert.pem --text --nooutWindows "Krypto-Shellerweiterungen"
Ausstellerklärung:
Unfortunately the window can't be resized
Browsers
Minimal webserver
Firefox
Chromium (Edge)
ASN.1 JavaScript decoder
Decode of a generated cert by
cargo run --example certificate_policies