|
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.smime.ess.ESSAttributeValue
iaik.smime.ess.MsgSigDigest
public class MsgSigDigest
The S/MIMEv3 ESS MsgSigDigest attribute.
The Enhanced Security Services
for S/MIMEv3 (ESS) (RFC 2634) specifies the MsgSigDigest
attribute to be included as an signed attribute in a SignerInfo created by an recipient when answering to a ReceiptRequest by sending a signed receipt
back to the originator:
msgSigDigest ::= OCTET STRING
id-aa-msgSigDigest OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) id-aa(2) 5}
When verifying the signature of a SignerInfo containing signed attributes
a hash has to be calculated over the DER encoding of the signed attributes
to be verified against the signature value. When the originator has requested
a signed receipt the hash value calculated above forms the value of a
MsgSigDigest attribute to be sent back to the originator as signed attribute.
The originator when verifying a Signed Receipt compares the message signature
digest value (kept from the original message or calculated again) with the
value of the msgSigDigest signedAttribute included in the signedData/Receipt
signerInfo. If these digest values are identical, then that proves that the
message signature digest value calculated by the recipient based on the
received original signedData object is the same as that calculated by the
sender. This proves that the recipient received exactly the same original
signedData content and signedAttributes as sent by the sender because that
is the only way that the recipient could have calculated the same message
signature digest value as calculated by the sender. If the digest values
are different, then the signedData/Receipt signature verification process
fails.
This class provides two constructors for creating a new MsgSigDigest.
The first one allows to immediately set
the digest value:
byte[] digest = ...; MsgSigDigest msgSigDigest = new MsgSigDigest(digest);The second
constructor may be used to
create MsgSigDigest attribute immediately from a SignerInfo object:
SignerInfo signerInfo = ...; MsgSigDigest msgSigDigest = new MsgSigDigest(signerInfo);
ReceiptRequest,
Receipt,
SignerInfo| Field Summary | |
|---|---|
static iaik.asn1.ObjectID |
oid
The attributeType object identifier of this MsgSigDigest attribute. |
| Constructor Summary | |
|---|---|
MsgSigDigest()
Empty default constructor. |
|
MsgSigDigest(iaik.asn1.ASN1Object obj)
Creates an MsgSigDigest from its ASN.1 representation. |
|
MsgSigDigest(byte[] digest)
Creates an MsgSigDigest for the given digest value. |
|
MsgSigDigest(SignerInfo signerInfo)
Creates a MsgSigDigest from the given SignerInfo. |
|
MsgSigDigest(SignerInfo signerInfo,
SecurityProvider securityProvider)
Creates a MsgSigDigest from the given SignerInfo. |
|
| Method Summary | |
|---|---|
void |
decode(iaik.asn1.ASN1Object obj)
Decodes the given ASN.1 MsgSigDigest object for parsing
the internal structure. |
boolean |
equals(java.lang.Object obj)
Compares this MsgSigDigest to the specified object. |
iaik.asn1.ObjectID |
getAttributeType()
Returns the OID identifying the MsgSigDigest attribute type. |
byte[] |
getDigest()
Returns the digest value. |
int |
hashCode()
Returns a hashcode for this object. |
iaik.asn1.ASN1Object |
toASN1Object()
Returns this MsgSigDigest as ASN1Object. |
java.lang.String |
toString()
Returns a string representation of this MsgSigDigest. |
| Methods inherited from class iaik.smime.ess.ESSAttributeValue |
|---|
multipleAllowed |
| 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
MsgSigDigest attribute.
The corresponding OID string is "1.2.840.113549.1.9.16.2.5".
| Constructor Detail |
|---|
public MsgSigDigest()
public MsgSigDigest(byte[] digest)
digest - the digest value
public MsgSigDigest(SignerInfo signerInfo)
throws ESSException
The value of the MsgSigDigest results from calculating a hash over the DER encoding of the signed attributes included in the given SignerInfo.
signerInfo - SignerInfo the SignerInfo from which to create the MsgSigDigest
ESSException - if no signed attributes are included in the
SignerInfo, or the hash algorithm to be used is not
supported or an error occurs when ancoding the signed
attributes
public MsgSigDigest(SignerInfo signerInfo,
SecurityProvider securityProvider)
throws ESSException
The value of the MsgSigDigest results from calculating a hash over the DER encoding of the signed attributes included in the given SignerInfo.
signerInfo - SignerInfo the SignerInfo from which to create the MsgSigDigestsecurityProvider - the SecurityProvider to be used by this object,
if null use the default system-wide
installed SecurityProvider; this constructor may
use the SecurityProvider method getHash() to calculate the hash from the SignerInfo
signed attributes
ESSException - if no signed attributes are included in the
SignerInfo, or the hash algorithm to be used is not
supported or an error occurs when ancoding the signed
attributespublic MsgSigDigest(iaik.asn1.ASN1Object obj)
obj - the MsgSigDigest as ASN1Object| Method Detail |
|---|
public byte[] getDigest()
public boolean equals(java.lang.Object obj)
MsgSigDigest to the specified object.
equals in class ESSAttributeValueobj - the object to compare this MsgSigDigest
against.
true, if the given object is equal to this
MsgSigDigest,
false otherwisepublic int hashCode()
hashCode in class ESSAttributeValuepublic void decode(iaik.asn1.ASN1Object obj)
MsgSigDigest object for parsing
the internal structure.
obj - the MsgSigDigest as ASN1Objectpublic iaik.asn1.ASN1Object toASN1Object()
public iaik.asn1.ObjectID getAttributeType()
getAttributeType in class iaik.asn1.structures.AttributeValuepublic 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 |
|