public class ContentReference extends ESSAttributeValue
The Enhanced Security Services
for S/MIMEv3 (ESS) (RFC 2634) specifies the ContentReference
attribute to may be included as an signed attribute in a SignerInfo
to link from one SignedData to another. It may be used to link a reply
to the original message to which it refers, or to incorporate by reference one
SignedData into another. The first SignedData must include a contentIdentifier
signed attribute. The second SignedData links to the first by including a
ContentReference signed attribute containing the content type, content identifier,
and signature value from the first SignedData:
ContentReference ::= SEQUENCE { contentType ContentType, signedContentIdentifier ContentIdentifier, originatorSignatureValue OCTET STRING } id-aa-contentReference OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) id-aa(2) 10 }When
creating
a new ContentReference the content type, signed content identifier
and originator signature value have to be supplied:
ObjectID contentType = ...; ContentIdentifier contentIdentifier = ...; byte[] originatorSignatureValue = ...; ContentReference contentReference = new ContentReference(contentType, contentIdentifier, originatorSignatureValue);
Modifier and Type | Field and Description |
---|---|
static iaik.asn1.ObjectID |
oid
The attributeType object identifier of this
ContentReference attribute. |
Constructor and Description |
---|
ContentReference()
Empty default constructor.
|
ContentReference(iaik.asn1.ASN1Object obj)
Creates an ContentReference from its ASN.1 representation.
|
ContentReference(iaik.asn1.ObjectID contentType,
ContentIdentifier signedContentIdentifier,
byte[] originatorSignatureValue)
Creates an ContentReference from given content type,
content identifier and originator signature value.
|
Modifier and Type | Method and Description |
---|---|
void |
decode(iaik.asn1.ASN1Object obj)
Decodes the given ASN.1
ContentReference object for parsing
the internal structure. |
boolean |
equals(java.lang.Object obj)
Compares this
ContentReference to the specified object. |
iaik.asn1.ObjectID |
getAttributeType()
Returns the OID identifying the ContentReference attribute type.
|
iaik.asn1.ObjectID |
getContentType()
Returns the content type.
|
byte[] |
getOriginatorSignatureValue()
Returns the originator signature value.
|
ContentIdentifier |
getSignedContentIdentifier()
Returns the signed content identifier.
|
int |
hashCode()
Returns a hashcode for this ContentReference.
|
iaik.asn1.ASN1Object |
toASN1Object()
Returns this ContentReference as ASN1Object.
|
java.lang.String |
toString()
Returns a string representation of this ContentReference.
|
multipleAllowed
public static final iaik.asn1.ObjectID oid
ContentReference
attribute.
The corresponding OID string is "1.2.840.113549.1.9.16.2.10".public ContentReference()
public ContentReference(iaik.asn1.ObjectID contentType, ContentIdentifier signedContentIdentifier, byte[] originatorSignatureValue)
contentType
- the content type of the of the SignedData
to be linked tosignedContentIdentifier
- the signed content identifier
of the SignedData to be linked tooriginatorSignatureValue
- the signature value of the
SignedData to be linked topublic ContentReference(iaik.asn1.ASN1Object obj) throws iaik.asn1.CodingException
obj
- the ContentReference as ASN1Objectiaik.asn1.CodingException
public iaik.asn1.ObjectID getContentType()
public ContentIdentifier getSignedContentIdentifier()
public byte[] getOriginatorSignatureValue()
public boolean equals(java.lang.Object obj)
ContentReference
to the specified object.equals
in class ESSAttributeValue
obj
- the object to compare this ContentReference
against.true
, if the given object is equal to this
ContentReference
,
false
otherwisepublic int hashCode()
hashCode
in class ESSAttributeValue
public void decode(iaik.asn1.ASN1Object obj) throws iaik.asn1.CodingException
ContentReference
object for parsing
the internal structure.obj
- the ContentReference as ASN1Objectiaik.asn1.CodingException
- if the encoding is invalidpublic iaik.asn1.ASN1Object toASN1Object()
public iaik.asn1.ObjectID getAttributeType()
getAttributeType
in class iaik.asn1.structures.AttributeValue
public java.lang.String toString()
toString
in class iaik.asn1.structures.AttributeValue