Skip navigation links

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

E10667-03


oracle.security.crypto.cms
Class CMSDigestedDataContentInfo

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

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

public class CMSDigestedDataContentInfo
extends CMSContentInfo

This class encapsulates a CMS object of content type digested-data.


Constructor Summary
CMSDigestedDataContentInfo()
          Creates an empty CMSDigestedDataContentInfo.
CMSDigestedDataContentInfo(CMSContentInfo contentInfo, oracle.security.crypto.core.AlgorithmIdentifier digestAlgID)
          Creates a CMSDigestedDataContentInfo object by computing the message digest of the given CMS object.
CMSDigestedDataContentInfo(CMSContentInfo contentInfo, oracle.security.crypto.core.AlgorithmIdentifier digestAlgID, byte[] digest)
          Creates a CMSDigestedDataContentInfo object with an already computed digest value.
CMSDigestedDataContentInfo(java.io.InputStream is)
          Creates a CMSDigestedDataContentInfo 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[] getDigest()
          Returns the message digest value.
 oracle.security.crypto.core.AlgorithmIdentifier getDigestAlgID()
          Returns the message digest algorithm.
 CMSContentInfo getEnclosed()
          Returns the digested content.
 oracle.security.crypto.asn1.ASN1ObjectID getEnclosedContentType()
          Returns the content type of the digested content.
protected  byte[] getExposedContent()
          Returns the contents octets of the DER encoding of the content field of this CMS object.
 oracle.security.crypto.asn1.ASN1Integer getVersion()
          Deprecated. As of Phaos CMS 2.0.1, replaced by getVersionNumber()
 java.math.BigInteger getVersionNumber()
          Returns the version number.
 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 CMS object is detached.
 void setEnclosed(CMSContentInfo content)
          Set the encapsulated content i.e.
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.
 void verify()
          Verify the Message Digest.
 void writeDetached(boolean writeDetached)
          Indicate if the CMS Object that is being digested should be omitted when creating the CMSDigestedDataContentInfo object.

 

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

CMSDigestedDataContentInfo

public CMSDigestedDataContentInfo()
Creates an empty CMSDigestedDataContentInfo.

CMSDigestedDataContentInfo

public CMSDigestedDataContentInfo(CMSContentInfo contentInfo,
                                  oracle.security.crypto.core.AlgorithmIdentifier digestAlgID)
                           throws java.security.NoSuchAlgorithmException
Creates a CMSDigestedDataContentInfo object by computing the message digest of the given CMS object.

Note the change in the exception thrown

Exception no longer thrown -- AlgorithmIdentifierException

Exception introduced -- NoSuchAlgorithmException

Parameters:
contentInfo - The CMS Object that is to be digested.
digestAlgID - The digest algorithm.
Throws:
AlgorithmIdentifierException - The message digest algorithm is not supported.
java.security.NoSuchAlgorithmException

CMSDigestedDataContentInfo

public CMSDigestedDataContentInfo(CMSContentInfo contentInfo,
                                  oracle.security.crypto.core.AlgorithmIdentifier digestAlgID,
                                  byte[] digest)
Creates a CMSDigestedDataContentInfo object with an already computed digest value.
Parameters:
contentInfo - The CMS Object that is to be digested.
digestAlgID - The message digest algorithm.
digest - The message digest of the CMS Object.

CMSDigestedDataContentInfo

public CMSDigestedDataContentInfo(java.io.InputStream is)
                           throws java.io.IOException
Creates a CMSDigestedDataContentInfo object, by reading a BER encoding from the specified input stream.
Parameters:
is - The input stream.
Throws:
java.io.IOException - If the input is not correctly formatted, has the wrong content type; or an I/O exception occurs.

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()

writeDetached

public void writeDetached(boolean writeDetached)
Indicate if the CMS Object that is being digested should be omitted when creating the CMSDigestedDataContentInfo object.

The default (true) is to ensure the CMS Object that is being digested is a part of the CMSDigestedDataContentInfo object.

Parameters:
writeDetached - true ensures the CMS Object being digested is not a part of the CMSDigestedDataContentInfo object; false ensures that the CMS Object being digested is a part of the CMSDigestedDataContentInfo object;

setEnclosed

public void setEnclosed(CMSContentInfo content)
Set the encapsulated content i.e. the CMS Object that was originally digested.

This method must be called before trying to the verify the digest of a detached CMSDigestedDataContentInfo Object.

Parameters:
content - The CMS Object.
See Also:
isDetached()

getEnclosed

public CMSContentInfo getEnclosed()
Returns the digested content.
Returns:
The CMS Object.

getEnclosedContentType

public oracle.security.crypto.asn1.ASN1ObjectID getEnclosedContentType()
Returns the content type of the digested content.
Returns:
The content type identifier.

getDigestAlgID

public oracle.security.crypto.core.AlgorithmIdentifier getDigestAlgID()
Returns the message digest algorithm.
Returns:
The digest algorithm identifier.

getDigest

public byte[] getDigest()
Returns the message digest value.
Returns:
The digest value.

getVersionNumber

public java.math.BigInteger getVersionNumber()
Returns the version number.
Returns:
The version number.

getVersion

public oracle.security.crypto.asn1.ASN1Integer getVersion()
Deprecated. As of Phaos CMS 2.0.1, replaced by getVersionNumber()
Returns the version number.
Returns:
The version number.

isDetached

public boolean isDetached()
Indicates if this CMS object is detached.
Specified by:
isDetached in class CMSContentInfo
Returns:
true if detached; 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 this object.

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.

verify

public void verify()
            throws oracle.security.crypto.core.AuthenticationException,
                   java.security.NoSuchAlgorithmException
Verify the Message Digest.

This method will always fail for a detached CMSDigestedDataContentInfo Object.

Note the change in the exception thrown

Exception no longer thrown -- AlgorithmIdentifierException

Exception introduced -- NoSuchAlgorithmException

Throws:
oracle.security.crypto.core.AuthenticationException - Message digest values are different.
java.security.NoSuchAlgorithmException - Invalid digest algorithm.
See Also:
(CMSContentInfo,AlgorithmIdentifier,byte[]), setEnclosed(CMSContentInfo)

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

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.
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-03


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