public class CMSContentType
extends iaik.asn1.structures.AttributeValue
The Cryptographic Message Syntax (CMS) (RFC 5652)
specifies the ContentType attribute to be included as an signed attribute in a
SignerInfo for representing the type of the content included in the corresponding SignedData
or as an authenticated attribute in a AuthenticatedData:
ContentType ::= OBJECT IDENTIFIER
id-contentType OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs9(9) 3 }
As soon as there are any signed attributes are present, the ContentType
attribute has to be included to specify the type the content of the
corresponding SignedData represents.
When creating a ContentType attribute
the content type oid has to be supplied, e.g.:
CMSContentType contentType = new CMSContentType(ObjectID.cms_data);
SignerInfo| Modifier and Type | Field and Description |
|---|---|
static iaik.asn1.ObjectID |
oid
The attributeType object identifier of the CMS ContentType attribute.
|
| Constructor and Description |
|---|
CMSContentType()
Empty default constructor.
|
CMSContentType(iaik.asn1.ASN1Object obj)
Creates an CMS ContentType from its ASN.1 representation.
|
CMSContentType(iaik.asn1.ObjectID contentType)
Creates a CMS ContentType for the given content type OID.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decode(iaik.asn1.ASN1Object obj)
Decodes the given ASN.1
ContentType object for parsing
the internal structure. |
boolean |
equals(java.lang.Object obj)
Compares this
ContentType to the specified object. |
iaik.asn1.ObjectID |
get()
Returns the content type oid.
|
iaik.asn1.ObjectID |
getAttributeType()
Returns the OID identifying the ContentType attribute type.
|
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 ContentType attribute. |
iaik.asn1.ASN1Object |
toASN1Object()
Returns this ContentType as ASN1Object.
|
java.lang.String |
toString()
Returns a string representation of this ContentType.
|
public static final iaik.asn1.ObjectID oid
public CMSContentType()
public CMSContentType(iaik.asn1.ObjectID contentType)
contentType - the content type oidpublic CMSContentType(iaik.asn1.ASN1Object obj)
obj - the CMS ContentType as ASN1Object (object identifier)public iaik.asn1.ObjectID get()
public boolean equals(java.lang.Object obj)
ContentType to the specified object.equals in class java.lang.Objectobj - the object to compare this ContentType
against.true, if the given object is equal to this
ContentType,
false otherwisepublic int hashCode()
hashCode in class java.lang.Objectpublic void decode(iaik.asn1.ASN1Object obj)
ContentType object for parsing
the internal structure.obj - the ContentType as ASN1Objectpublic iaik.asn1.ASN1Object toASN1Object()
throws iaik.asn1.CodingException
iaik.asn1.CodingException - if the ASN1Object cannot be builtpublic 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 ContentType 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