Skip navigation links

Oracle Fusion Middleware CMS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10667-04


oracle.security.crypto.cms
Class CMSDataContentInfo

java.lang.Object
  extended by oracle.security.crypto.cms.CMSContentInfo
      extended by oracle.security.crypto.cms.CMSDataContentInfo

All Implemented Interfaces:
oracle.security.crypto.asn1.ASN1Object, oracle.security.crypto.util.Streamable

public class CMSDataContentInfo
extends CMSContentInfo

This class encapsulates a CMS object of content type Data.

There is no enclosed CMS object. The actual bytes of data can be retrieved with the getData() method.

The data content type is intended to refer to arbitrary octet strings, the interpration of which is left to the application. The data content type (CMSDataContentInfo) is generally encapsulated in a signed-data (CMSSignedDataContentInfo), enveloped-data (CMSEnvelopedDataContentInfo), digested-data (CMSDigestedDataContentInfo), encrypted-data (CMSEncryptedDataContentInfo) or authenticated-data (CMSAuthenticatedDataContentInfo) CMS object.


Constructor Summary
CMSDataContentInfo()
          Creates an empty CMSDataContentInfo.
CMSDataContentInfo(byte[] documentBytes)
          Creates a CMSDataContentInfo.
CMSDataContentInfo(java.io.InputStream is)
          Creates a CMSDataContentInfo object by reading a BER encoding from the specified input stream.

 

Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 byte[] getData()
          Returns the content.
protected  byte[] getExposedContent()
          Returns the contents octets of the DER encoding of the content field of this CMS object.
 int hashCode()
          Returns a hash code value for this object.
protected  void inputContent(java.io.InputStream is)
          Initializes this object by reading the Content field of the CMS ContentInfo structure i.e.
 boolean isDetached()
          Indicates if this object is detached.
protected  void setExposedContent(byte[] expContent)
          Returns the contents octets of the DER encoding of the content field of this CMS object.
 java.lang.String toString()
          Returns a brief text description of this object.
protected  void update()
          Clears the internal output cache.

 

Methods inherited from class oracle.security.crypto.cms.CMSContentInfo
computeDigest, contentTypeName, getContentType, input, inputInstance, isDegenerate, length, output

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Constructor Detail

CMSDataContentInfo

public CMSDataContentInfo()
Creates an empty CMSDataContentInfo.

CMSDataContentInfo

public CMSDataContentInfo(byte[] documentBytes)
Creates a CMSDataContentInfo.
Parameters:
documentBytes - The contents.

CMSDataContentInfo

public CMSDataContentInfo(java.io.InputStream is)
                   throws java.io.IOException
Creates a CMSDataContentInfo object by reading a BER encoding from the specified input stream.

An exception will be thrown if an encoding for a empty CMS object is encountered. Therefore the result of this constructor, if it returns successfully, is guaranteed to be non empty.

Parameters:
is - The input stream.
Throws:
java.io.IOException - If the input is not correctly formatted, has the wrong content type, or the content is missing; or an I/O exception occurs while reading from the input stream.

Method Detail

setExposedContent

protected void setExposedContent(byte[] expContent)
Description copied from class: CMSContentInfo
Returns the contents octets of the DER encoding of the content field of this CMS object. The value returned is suitable for input to the "message-digesting" and "content-encryption" process of RFC-2630.
Specified by:
setExposedContent in class CMSContentInfo
See Also:
CMSContentInfo.isDetached()

getExposedContent

protected byte[] getExposedContent()
Description copied from class: CMSContentInfo
Returns the contents octets of the DER encoding of the content field of this CMS object. The value returned is suitable for input to the "message-digesting" and "content-encryption" process of RFC-2630.
Specified by:
getExposedContent in class CMSContentInfo
Returns:
The contents octets or null for a detached CMS object.
See Also:
CMSContentInfo.isDetached()

isDetached

public boolean isDetached()
Indicates if this object is detached.
Specified by:
isDetached in class CMSContentInfo
Returns:
true if no content is present; false otherwise.
See Also:
CMSContentInfo.isDetached()

toString

public java.lang.String toString()
Returns a brief text description of this object.
Overrides:
toString in class java.lang.Object
Returns:
A string description of this object.

getData

public byte[] getData()
Returns the content.
Returns:
Returns the content or null if the object is detached.

inputContent

protected void inputContent(java.io.InputStream is)
                     throws java.io.IOException
Description copied from class: CMSContentInfo
Initializes this object by reading the Content field of the CMS ContentInfo structure i.e. the input stream must be positioned at the value octets of the Content field i.e. after the explicit [0] tag.

This method must be implemented by subclasses. It is unlikely that package users will ever need to call it directly.

Specified by:
inputContent in class CMSContentInfo
Throws:
java.io.IOException

hashCode

public int hashCode()
Returns a hash code value for this object.
Overrides:
hashCode in class java.lang.Object
Returns:
The hash code value.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
Overrides:
equals in class java.lang.Object
Returns:
true if this object is the same as the obj argument; false otherwise.

update

protected void update()
Clears the internal output cache. This method is called automatically if the object ever changes, so API users need not be concerned with it. Implementors of subclasses, however, do need to ensure that it gets called when appropriate (unless the subclass implements its own output method).
Overrides:
update in class CMSContentInfo

Skip navigation links

Oracle Fusion Middleware CMS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10667-04


Copyright © 2005, 2011 , Oracle. All rights reserved.