com.cms.crypto
Class HMACWithSHA1
java.lang.Object
schemajic.model.ASN1Value
schemajic.model.ASN1Sequence
com.cms.types.MessageAuthenticationCodeAlgorithm
com.cms.crypto.HMACWithSHA1
public class HMACWithSHA1
- extends MessageAuthenticationCodeAlgorithm
An algorithm identifier for the Hashed MAC with SHA1 (HMAC) algorithm.
For this hashed MAC algorithm, the open type must contain the complete encoding
of a value of type NULL. The value of an open type is not visible to the codec,
which conforms to the requirements for open types in the ASN.1 standards. So, the
value of the parameters component of an AlgorithmIdentifier type must be pre-
encoded and set before the value of AlgorithmIdentifier type can be encoded.
From IETF RFC 3370
The HMAC with SHA-1 algorithm is described in RFC 2104 [HMAC]. The
algorithm identifier for HMAC with SHA-1 is:
hMAC-SHA1 OBJECT IDENTIFIER ::= { iso(1)
identified-organization(3) dod(6) internet(1) security(5)
mechanisms(5) 8 1 2 }
There are two possible encodings for the HMAC with SHA-1
AlgorithmIdentifier parameters field. The two alternatives arise
from the fact that when the 1988 syntax for the AlgorithmIdentifier
type was translated into the 1997 syntax, the OPTIONAL associated
with the AlgorithmIdentifier parameters got lost. Later the OPTIONAL
was recovered via a defect report, but by then many people thought
that algorithm parameters were mandatory. Because of this history
some implementations may encode parameters as a NULL while others
omit them entirely.
The AlgorithmIdentifier parameters field is OPTIONAL. If present,
the parameters field MUST contain a NULL. Implementations MUST
treat HMAC with SHA-1 AlgorithmIdentifiers with absent parameters
as valid. Implementations MUST treat HMAC with SHA-1 AlgorithmIdentifiers
with NULL parameters as valid. Implementations SHOULD generate HMAC
with SHA-1 AlgorithmIdentifiers with absent parameters.
- Version:
- 1.00 - 2006/01/17
- Author:
- support@phillipgriffin.com
|
Constructor Summary |
HMACWithSHA1()
Constructor for HMACWithSHA1 with no parameters. |
HMACWithSHA1(ASN1OpenType parameters)
Constructor for HMACWithSHA1 with parameters
expressed as a valid encoding of a value of ASN.1 type NULL. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HMACWithSHA1
public HMACWithSHA1()
- Constructor for
HMACWithSHA1 with no parameters.
HMACWithSHA1
public HMACWithSHA1(ASN1OpenType parameters)
- Constructor for
HMACWithSHA1 with parameters
expressed as a valid encoding of a value of ASN.1 type NULL.
- Parameters:
parameters - a valid ASN.1 encoded value
Copyright © 2005-2006 GRIFFIN Consulting. All Rights Reserved.