com.rsa.certj.pkcs7

Class Data

java.lang.Object
  |
  +--com.rsa.certj.pkcs7.ContentInfo
        |
        +--com.rsa.certj.pkcs7.Data
All Implemented Interfaces:
Cloneable, Serializable

public class Data
extends ContentInfo
implements Cloneable, Serializable

This class encodes and decodes the PKCS #7 Data type.

The ASN.1 definition is as follows:

 Data ::= OCTET STRING
 

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

See Also

Serialized Form

Fields inherited from class com.rsa.certj.pkcs7.ContentInfo
DATA, DIGESTED_DATA, ENCRYPTED_DATA, ENVELOPED_DATA, NO_CONTENT, PKCS7_VERSION_NUMBER_0, PKCS7_VERSION_NUMBER_1, SIGNED_DATA
 

Constructor Summary

Data()

Creates a new object to encode or decode PKCS #7 Data.

 

Method Summary

 void

clearSensitiveData()

Clears any sensitive data.

 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 Data; returns false otherwise.

 byte[]

getData()

Gets the content in this Data object.

 int

getUnprocessedDataLen()

Returns the number of bytes in the internal buffer that contains the unprocessed data.

 void

setContent(byte[] octetString, int offset, int len)

Sets the content in this Data object.

 
Methods inherited from class com.rsa.certj.pkcs7.ContentInfo
bytesRead, clearInternalContentBuffer, endOfMessage, getContent, getContentInfoDERLen, getContentInfoDERLen, getContentType, getDevice, getDeviceList, getInstance, getInstance, getMessageType, getMessageType, readFinal, readInit, readInit, readInit, readUpdate, setCertJ, setCertPath, setDevice, writeMessage, writeMessage
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Data

public Data()
Creates a new object to encode or decode PKCS #7 Data.
Method Detail

setContent

public void setContent(byte[] octetString,
                       int offset,
                       int len)
                throws PKCS7Exception
Sets the content in this Data object.

Parameters

         octetString  

A byte array that contains arbitrary OctetString.

         offset  

The offset into the OctetString array.

         len  

The length of this OctetString

Throws

PKCS7Exception - If octetString is null.

getData

public byte[] getData()
Gets the content in this Data object.

Returns

A new byte array that contains arbitrary data.

getUnprocessedDataLen

public int getUnprocessedDataLen()
Returns the number of bytes in the internal buffer that contains the unprocessed data.

Overrides

getUnprocessedDataLen in class ContentInfo

Returns

The number of bytes of unprocessed data.

equals

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

Overrides

equals in class Object

Parameters

         obj  

An instance of the Data class.

Returns

A boolean indicating whether these objects are equal.

clone

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

Overrides

clone in class ContentInfo

Returns

A copy of this object in its current state.

Throws

CloneNotSupportedException - If the cloning operation is not successful.

clearSensitiveData

public void clearSensitiveData()
Clears any sensitive data. The finalizer will clear the data, but it is not known when the garbage collector will call the finalizer. This method clears all sensitive data as soon as possible.

Overrides

clearSensitiveData in class ContentInfo


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