com.rsa.certj.cert.attributes

Class ContentType

java.lang.Object
  |
  +--com.rsa.certj.cert.attributes.X501Attribute
        |
        +--com.rsa.certj.cert.attributes.ContentType
All Implemented Interfaces:
Cloneable, Serializable

public class ContentType
extends X501Attribute
implements Cloneable, Serializable

This class holds, encodes, and decodes the content-type attribute. The content-type attribute is defined in PKCS #9 v2. It specifies the content-type of the ContentInfo value being signed in the PKCS #7 digitally signed data. The content-type attribute type is required if there are any PKCS #7 authenticated attributes. It can be created by the user. If other authenticated attributes are present in a PKCS #7 signed data message that the user is creating, Cert-J adds this attribute with the correct value to the authenticated attributes, if it is not already present.

ContentType ::= OBJECT IDENTIFIER
 

Copyright © RSA Security Inc., 1999-2001. All rights reserved.

See Also

Serialized Form

Fields inherited from class com.rsa.certj.cert.attributes.X501Attribute
CHALLENGE_PASSWORD, CONTENT_TYPE, COUNTRY_OF_CITIZENSHIP, COUNTRY_OF_RESIDENCE, CRS_DUAL_STATUS, CRS_FAILURE_INFO, CRS_MESSAGE_TYPE, CRS_PKI_STATUS, CRS_RECIPIENT_NONCE, CRS_SENDER_NONCE, CRS_TRANSACTION_ID, CRS_VERSION, DATE_OF_BIRTH, FRIENDLY_NAME, GENDER, LOCAL_KEY_ID, MESSAGE_DIGEST, NON_STANDARD, PLACE_OF_BIRTH, POSTAL_ADDRESS, PSEUDONYM, SIGNING_TIME, SMART_CSP, X509_V3_EXTENSION
 

Constructor Summary

ContentType()

Constructs an empty ContentType object.

ContentType(byte[] type, int offset, int len)

Constructs a ContentType object and initializes it with the values given.

 

Method Summary

 Object

clone()

Overrides the default clone method to get a deeper clone.

 boolean

equals(Object obj)

Returns true if this object and obj contain the same ContentType, returns false otherwise.

 byte[]

getContentType()

Gets the value of this attribute, the content type.

 void

setContentType(byte[] theType, int offset, int len)

Sets the value of this attribute.

 
Methods inherited from class com.rsa.certj.cert.attributes.X501Attribute
clearSensitiveData, compareOID, derEncodeAttributeLen, getAttributeType, getAttributeTypeString, getDEREncoding, getDERLen, getInstance, getNextBEROffset, getOID, isAttributeType
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentType

public ContentType()
Constructs an empty ContentType object.

ContentType

public ContentType(byte[] type,
                   int offset,
                   int len)
Constructs a ContentType object and initializes it with the values given.

Parameters

         type  

The content OID (for example, SignedData OID). The complete list of PKCS #7 type OIDs is defined in the ContentInfo class.

         offset  

The offset into the type array.

         len  

The length of the data in the type array.

Method Detail

setContentType

public void setContentType(byte[] theType,
                           int offset,
                           int len)
Sets the value of this attribute. Sets the ContentType to theType.

Parameters

         theType  

The content OID (for example, SignedData OID). The complete list of PKCS #7 type OIDs is defined in the ContentInfo class.

         offset  

The offset into the theType array.

         len  

The length of the data in the theType array.


getContentType

public byte[] getContentType()
Gets the value of this attribute, the content type.

Returns

A new byte array specifing the ContentType.

clone

public Object clone()
             throws CloneNotSupportedException
Overrides the default clone method to get a deeper clone.

Overrides

clone in class X501Attribute

Returns

A new ContentType object, a copy of this object.

Throws

CloneNotSupportedException - If the cloning operation is not successful.

equals

public boolean equals(Object obj)
Returns true if this object and obj contain the same ContentType, returns false otherwise.

Overrides

equals in class Object

Parameters

         obj  

The instance of the ContentType object.

Returns

A boolean indicating whether these objects are equal.


RSA BSAFE ® Cert-J 2.1.1 001-047007-211-001-000