iaik.smime.ess
Class ContentReference

java.lang.Object
  extended by iaik.asn1.structures.AttributeValue
      extended by iaik.smime.ess.ESSAttributeValue
          extended by iaik.smime.ess.ContentReference
All Implemented Interfaces:
ASN1Type

public class ContentReference
extends ESSAttributeValue

The S/MIMEv3 ESS ContentReference attribute.

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);
 


Field Summary
static ObjectID oid
          The attributeType object identifier of this ContentReference attribute.
 
Constructor Summary
ContentReference()
          Empty default constructor.
ContentReference(ASN1Object obj)
          Creates an ContentReference from its ASN.1 representation.
ContentReference(ObjectID contentType, ContentIdentifier signedContentIdentifier, byte[] originatorSignatureValue)
          Creates an ContentReference from given content type, content identifier and originator signature value.
 
Method Summary
 void decode(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.
 ObjectID getAttributeType()
          Returns the OID identifying the ContentReference attribute type.
 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.
 ASN1Object toASN1Object()
          Returns this ContentReference as ASN1Object.
 java.lang.String toString()
          Returns a string representation of this ContentReference.
 
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

oid

public static final ObjectID oid
The attributeType object identifier of this ContentReference attribute. The corresponding OID string is "1.2.840.113549.1.9.16.2.10".

Constructor Detail

ContentReference

public ContentReference()
Empty default constructor. Required for dynamic object creation. Shall NOT be used by an application.


ContentReference

public ContentReference(ObjectID contentType,
                        ContentIdentifier signedContentIdentifier,
                        byte[] originatorSignatureValue)
Creates an ContentReference from given content type, content identifier and originator signature value.

Parameters:
contentType - the content type of the of the SignedData to be linked to
signedContentIdentifier - the signed content identifier of the SignedData to be linked to
originatorSignatureValue - the signature value of the SignedData to be linked to

ContentReference

public ContentReference(ASN1Object obj)
                 throws CodingException
Creates an ContentReference from its ASN.1 representation.

Parameters:
obj - the ContentReference as ASN1Object
Throws:
CodingException
Method Detail

getContentType

public ObjectID getContentType()
Returns the content type.

Returns:
the content type

getSignedContentIdentifier

public ContentIdentifier getSignedContentIdentifier()
Returns the signed content identifier.

Returns:
the signed content identifier

getOriginatorSignatureValue

public byte[] getOriginatorSignatureValue()
Returns the originator signature value.

Returns:
the originator signature value

equals

public boolean equals(java.lang.Object obj)
Compares this ContentReference to the specified object.

Specified by:
equals in class ESSAttributeValue
Parameters:
obj - the object to compare this ContentReference against.
Returns:
true, if the given object is equal to this ContentReference, false otherwise

hashCode

public int hashCode()
Returns a hashcode for this ContentReference.

Overrides:
hashCode in class ESSAttributeValue
Returns:
a hashcode for this ContentReference

decode

public void decode(ASN1Object obj)
            throws CodingException
Decodes the given ASN.1 ContentReference object for parsing the internal structure.

Parameters:
obj - the ContentReference as ASN1Object
Throws:
CodingException - if the encoding is invalid

toASN1Object

public ASN1Object toASN1Object()
Returns this ContentReference as ASN1Object.

Returns:
this ContentReference as ASN1Object

getAttributeType

public ObjectID getAttributeType()
Returns the OID identifying the ContentReference attribute type.

Specified by:
getAttributeType in class AttributeValue
Returns:
the OID identifying the ContentReference attribute type.

toString

public java.lang.String toString()
Returns a string representation of this ContentReference.

Specified by:
toString in class AttributeValue
Returns:
this ContentReference as string

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

IAIK-CMS 5.1, (c) 2002 IAIK, (c) 2003 - 2010 SIC