|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.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 ObjectID |
oid
The attributeType object identifier of this MsgSigDigest attribute. |
Constructor Summary | |
---|---|
MsgSigDigest()
Empty default constructor. |
|
MsgSigDigest(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(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. |
ObjectID |
getAttributeType()
Returns the OID identifying the MsgSigDigest attribute type. |
byte[] |
getDigest()
Returns the digest value. |
int |
hashCode()
Returns a hashcode for this object. |
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 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 valuepublic 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
attributespublic 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(ASN1Object obj)
obj
- the MsgSigDigest as ASN1ObjectMethod Detail |
---|
public byte[] getDigest()
public boolean equals(java.lang.Object obj)
MsgSigDigest
to the specified object.
equals
in class ESSAttributeValue
obj
- the object to compare this MsgSigDigest
against.
true
, if the given object is equal to this
MsgSigDigest
,
false
otherwisepublic int hashCode()
hashCode
in class ESSAttributeValue
public void decode(ASN1Object obj)
MsgSigDigest
object for parsing
the internal structure.
obj
- the MsgSigDigest as ASN1Objectpublic ASN1Object toASN1Object()
public ObjectID getAttributeType()
getAttributeType
in class AttributeValue
public java.lang.String toString()
toString
in class AttributeValue
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |