|
IAIK CMS/SMIME Toolkit API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectiaik.asn1.structures.AttributeValue
iaik.cms.attributes.CMSMessageDigest
public class CMSMessageDigest
The CMS MessageDigest attribute.
The Cryptographic Message Syntax (CMS) (RFC 5652)
specifies the MessageDigest attribute to be included as an signed attribute in a
SignerInfo or as an authenticated attribute in a AuthenticatedData
for representing the hash value computed on the content data:
MessageDigest ::= OCTET STRING
id-messageDigest OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs9(9) 4 }
As soon as there are any signed (or authenticated) attributes are present, the MessageDigest
attribute has to be included to "keep" the original hash computed on the
content data. Note that when signed attributes are present in fact two
hash values are calculated: the first one over the content data (giving
the value of the MessageDigest attribute) and the second one over the
DER encoding of the signed attributes (giving the final signature value
itself).
When creating a CMSMessageDigest attribute
the hash value has to be supplied:
byte[] digest = ...; CMSMessageDigest messageDigest = new CMSMessageDigest(digest);
SignerInfo| Field Summary | |
|---|---|
static iaik.asn1.ObjectID |
oid
The attributeType object identifier of the CMS MessageDigest attribute. |
| Constructor Summary | |
|---|---|
CMSMessageDigest()
Empty default constructor. |
|
CMSMessageDigest(iaik.asn1.ASN1Object obj)
Creates an CMS MessageDigest from its ASN.1 representation. |
|
CMSMessageDigest(byte[] digest)
Creates a CMS MessageDigest for the given digest value. |
|
| Method Summary | |
|---|---|
void |
decode(iaik.asn1.ASN1Object obj)
Decodes the given ASN.1 CMSMessageDigest object for parsing
the internal structure. |
boolean |
equals(java.lang.Object obj)
Compares this CMSMessageDigest to the specified object. |
iaik.asn1.ObjectID |
getAttributeType()
Returns the OID identifying the CMSMessageDigest attribute type. |
byte[] |
getDigest()
Returns the digest value. |
int |
hashCode()
Returns a hashcode for this object. |
boolean |
multipleAllowed()
Returns false since only one AttributeValue is
allowed in the SET OF AttributeValue of an MessageDigest attribute. |
iaik.asn1.ASN1Object |
toASN1Object()
Returns this CMSMessageDigest as ASN1Object. |
java.lang.String |
toString()
Returns a string representation of this CMSMessageDigest. |
| Methods inherited from class iaik.asn1.structures.AttributeValue |
|---|
getName |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final iaik.asn1.ObjectID oid
| Constructor Detail |
|---|
public CMSMessageDigest()
public CMSMessageDigest(byte[] digest)
digest - the digest valuepublic CMSMessageDigest(iaik.asn1.ASN1Object obj)
obj - the CMS MessageDigest as ASN1Object| Method Detail |
|---|
public byte[] getDigest()
public boolean equals(java.lang.Object obj)
CMSMessageDigest to the specified object.
equals in class java.lang.Objectobj - the object to compare this CMSMessageDigest
against.
true, if the given object is equal to this
CMSMessageDigest,
false otherwisepublic int hashCode()
hashCode in class java.lang.Objectpublic void decode(iaik.asn1.ASN1Object obj)
CMSMessageDigest object for parsing
the internal structure.
obj - the CMSMessageDigest as ASN1Objectpublic iaik.asn1.ASN1Object toASN1Object()
public iaik.asn1.ObjectID getAttributeType()
getAttributeType in class iaik.asn1.structures.AttributeValuepublic boolean multipleAllowed()
false since only one AttributeValue is
allowed in the SET OF AttributeValue of an MessageDigest attribute.
multipleAllowed in class iaik.asn1.structures.AttributeValuefalse since only one attribute value is allowedpublic java.lang.String toString()
toString in class iaik.asn1.structures.AttributeValue
|
IAIK CMS/SMIME Toolkit API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
|
v6.1 (c) 2002 IAIK, (c) 2003 - 2025 SIC |
|