hashes icon indicating copy to clipboard operation
hashes copied to clipboard

sha2: provide support for `spki::AlgorithmIdentifier`

Open baloo opened this issue 1 year ago • 1 comments

This implements AlgorithmIdentifier according to RFC5754 section 2

Depends on https://github.com/RustCrypto/traits/pull/1575

baloo avatar May 22 '24 05:05 baloo

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

baloo avatar May 23 '24 02:05 baloo