hashes
hashes copied to clipboard
sha2: provide support for `spki::AlgorithmIdentifier`
This implements AlgorithmIdentifier according to RFC5754 section 2
Depends on https://github.com/RustCrypto/traits/pull/1575
From the RFC:
The AlgorithmIdentifier parameters field is OPTIONAL.
Implementations MUST accept SHA2 AlgorithmIdentifiers with absent
parameters. Implementations MUST accept SHA2 AlgorithmIdentifiers
with NULL parameters. Implementations MUST generate SHA2
AlgorithmIdentifiers with absent parameters.
This implementation generates AlgorithmIdentifier with parameters absent, but it would be nice if we could also provide a PartialEq that accepted NULL parameters.
(same situation exists in https://www.rfc-editor.org/rfc/rfc3370#section-2.1 for Sha1)
cc @carl-wallace