|
|||||||||
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.ContentHints
public class ContentHints
The S/MIMEv3 ESS ContentHints attribute.
The Enhanced Security Services
for S/MIMEv3 (ESS) (RFC 2634) specifies the ContentHints
attribute to may be included as an attribute in a SignerInfo
to provide information describing the innermost signed content of
a multi-layer message at the outermost signature layer.
ContentHints ::= SEQUENCE { contentDescription UTF8String (SIZE (1..MAX)) OPTIONAL, contentType ContentType } id-aa-contentHint OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) id-aa(2) 4}The contentDescription field may be used to provide information that the recipient may use to select protected messages for processing, such as a message subject. If this field is set, then the attribute is expected to appear on the signedData object enclosing an envelopedData object and not on the inner signedData object. The (SIZE (1..MAX)) construct constrains the sequence to have at least one entry. MAX indicates the upper bound is unspecified. Implementations are free to choose an upper bound that suits their environment.
When creating
a ContentHints object
the content type object identifier has to be supplied. Subsequently
method setContentDescription
may be called to provide a string describing the content:
ObjectID contentType = ...; String contentDescription = ...; ContentHints contentHints = new ContentHints(contentType); contentHints.setContentDescription(contentDescription);
Field Summary | |
---|---|
static ObjectID |
oid
The attributeType object identifier of this ContentHints attribute. |
Constructor Summary | |
---|---|
ContentHints()
Empty default constructor. |
|
ContentHints(ASN1Object obj)
Creates an ContentHints from its ASN.1 representation. |
|
ContentHints(ObjectID contentType)
Creates an ContentHints for the given content type. |
Method Summary | |
---|---|
void |
decode(ASN1Object obj)
Decodes the given ASN.1 ContentHints object for parsing
the internal structure. |
boolean |
equals(java.lang.Object obj)
Compares this ContentHints to the specified object. |
ObjectID |
getAttributeType()
Returns the OID identifying the ContentHints attribute type. |
java.lang.String |
getContentDescription()
Returns the (first) content description, if included. |
java.lang.String[] |
getContentDescriptions()
Returns the (first) content description, if included. |
ObjectID |
getContentType()
Returns the content type. |
int |
hashCode()
Returns a hashcode for this ContentHints . |
void |
setContentDescription(java.lang.String contentDescription)
Sets the content description. |
void |
setContentDescriptions(java.lang.String[] contentDescriptions)
Sets the content descriptions (if more than one content description is used). |
static void |
setMaxNumOfContentDescriptions(int max)
Sets the allowed number of content description fields. |
ASN1Object |
toASN1Object()
Returns this ContentHints as ASN1Object. |
java.lang.String |
toString()
Returns a string representation of this ContentHints. |
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
ContentHints
attribute.
The corresponding OID string is "1.2.840.113549.1.9.16.2.4".
Constructor Detail |
---|
public ContentHints()
public ContentHints(ObjectID contentType)
contentType
- the content typepublic ContentHints(ASN1Object obj) throws CodingException
obj
- the ContentHints as ASN1Object
CodingException
- if the encoding is invalidMethod Detail |
---|
public static void setMaxNumOfContentDescriptions(int max)
max
- the max number of content description fields (default: 1).public ObjectID getContentType()
public void setContentDescription(java.lang.String contentDescription)
The contentDescription field may be used to provide information that the recipient may use to select protected messages for processing, such as a message subject. If this field is set, then the ContentHints attribute is expected to appear on the signedData object enclosing an envelopedData object and not on the inner signedData object.
contentDescription
- a string describing the contentpublic void setContentDescriptions(java.lang.String[] contentDescriptions)
The contentDescription field may be used to provide information that the recipient may use to select protected messages for processing, such as a message subject. If this field is set, then the ContentHints attribute is expected to appear on the signedData object enclosing an envelopedData object and not on the inner signedData object.
contentDescriptions
- the content description terms to be set
java.lang.IllegalArgumentException
- if the number of content description terms exceeds
the maximum allowed number setMaxNumOfContentDescriptions
of content description
terms or any of the array elements is nullpublic java.lang.String getContentDescription()
The contentDescription field may be used to provide information that the recipient may use to select protected messages for processing, such as a message subject. If this field is set, then the ContentHints attribute is expected to appear on the signedData object enclosing an envelopedData object and not on the inner signedData object.
null
if no
ContentDescription is includedpublic java.lang.String[] getContentDescriptions()
The contentDescription field may be used to provide information that the recipient may use to select protected messages for processing, such as a message subject. If this field is set, then the ContentHints attribute is expected to appear on the signedData object enclosing an envelopedData object and not on the inner signedData object.
null
if no
ContentDescription is includedpublic void decode(ASN1Object obj) throws CodingException
ContentHints
object for parsing
the internal structure.
obj
- the ContentHints as ASN1Object
CodingException
- if the encoding is invalidpublic ASN1Object toASN1Object()
public ObjectID getAttributeType()
getAttributeType
in class AttributeValue
public boolean equals(java.lang.Object obj)
ContentHints
to the specified object.
equals
in class ESSAttributeValue
obj
- the object to compare this ContentHints
against.
true
, if the given object is equal to this
ContentHints
,
false
otherwisepublic int hashCode()
ContentHints
.
hashCode
in class ESSAttributeValue
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 |