6 Apr 2007 20:30
AlgorithmIdentifier, SHA-1, etc.
Eric Rescorla <ekr <at> networkresonance.com>
2007-04-06 18:30:49 GMT
2007-04-06 18:30:49 GMT
I'm trying to get a handle on how one ought to encode AlgorithmIdentifier.
As people will perhaps remember, the ASN.1 is:
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL }
-- contains a value of the type
-- registered for use with the
-- algorithm object identifier value
Present hash functions do not take any useful parameters, leaving
us with two encoding options:
- omit the parameter.
- include a NULL
To make things more complicated, there are (at least) two different
contexts in which this production appears:
- The S/MIME DigestAlgorithmIdentifier production.
- Inside the DigestInfo of the S/MIME signature.
RFC 3370's guidance is to omit the parameter for SHA-1 and include
a NULL for MD5 (see S 2.1 and 2.2.).
However, the current PKCS#1 errata
(ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1errata.txt)
recommend that when one is encoding DigestInfo, one should
(Continue reading)
RSS Feed