Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools CMS Java API Reference 10g Release 3 (10.1.3) B25377-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.crypto.cms
Class CMSDigestedDataInputStream

`java.lang.Object
java.io.InputStream
java.io.FilterInputStream
oracle.security.crypto.cms.CMSInputStream
oracle.security.crypto.cms.CMSDigestedDataInputStream`

public class CMSDigestedDataInputStream
extends CMSInputStream

A `CMSDigestedDataInputStream` is used to read `digested-data` CMS objects.

A `CMSDigestedDataInputStream` is essentially a input stream filter that unwraps the CMS `digested-data` structure from the data read in.

You will be able to read a detached digested-data object using the `CMSDigestedDataInputStream` class but you will not be able to verify the digest.

IMPORTANT: This class processes large CMS digested-data Objects more efficiently (Java VM memory usage) than the `CMSDigestedDataContentInfo` class.

See Also:
  `CMSInputConnector`, `CMSDigestedDataInputConnector`, `CMSDigestedDataContentInfo`

Field Summary

Fields inherited from class java.io.FilterInputStream
`in`

Constructor Summary
`CMSDigestedDataInputStream(CMSInputConnector conn)` Creates a `CMSDigestedDataInputStream`.
`CMSDigestedDataInputStream(java.io.InputStream in)` Creates a `CMSDigestedDataInputStream`.

Method Summary
`int` | `available()`
`byte[]` | `getDigest()` Returns the message digest value.
`oracle.security.crypto.core.AlgorithmIdentifier` | `getDigestAlgID()` Returns the message digest algorithm.
`oracle.security.crypto.asn1.ASN1ObjectID` | `getEnclosedContentType()` Returns the content type of the digested content.
`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 of this CMS Object.
`void` | `mark(int readlimit)` Not supported.
`boolean` | `markSupported()` Always returns `false</false>.`
`int` | `read()`
`int` | `read(byte[] buffer, int offset, int len)`
`void` | `reset()` Not supported.
`long` | `skip(long n)`
`void` | `terminate()` Finish reading the `digested-data` structure.
`void` | `verify()` Verify the Message Digest.

Methods inherited from class java.io.FilterInputStream
`close, read`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CMSDigestedDataInputStream

    public CMSDigestedDataInputStream(java.io.InputStream in)

  Creates a `CMSDigestedDataInputStream`.
Parameters:
  `in` - The underlying input stream.

### CMSDigestedDataInputStream

    public CMSDigestedDataInputStream(CMSInputConnector conn)

  Creates a `CMSDigestedDataInputStream`.
Parameters:
  `conn` - The underlying input connector.

Method Detail

### terminate

    public void terminate()
                   throws java.io.IOException

  Finish reading the `digested-data` structure.

  Invoke this method only after all the underlying content has been read.

  Specified by:
    `terminate` in class `CMSInputStream`
  Throws:
    `java.io.IOException` - An I/O error occurred or some of the underlying content is still present in the input stream.

### getVersionNumber

    public java.math.BigInteger getVersionNumber()
                                          throws java.io.IOException

  Returns the version number of this CMS Object.
  Returns:
    The version number.
  Throws:
    `java.io.IOException` - An I/O error occurred or the input is incorrectly encoded.

### getVersion

    public oracle.security.crypto.asn1.ASN1Integer getVersion()
                                                       throws java.io.IOException

  Deprecated. As of Phaos CMS 2.0.1, replaced by `getVersionNumber()`
  Returns the version number of this CMS Object.
  Returns:
    The version number.
  Throws:
    `java.io.IOException` - An I/O error occurred or the input is incorrectly encoded.

### getDigest

    public byte[] getDigest()
                     throws java.io.IOException

  Returns the message digest value.
  Returns:
    The digest value.
  Throws:
    `java.io.IOException` - An I/O error occurred or the input is incorrectly encoded.

### getDigestAlgID

    public oracle.security.crypto.core.AlgorithmIdentifier getDigestAlgID()
                                                                   throws java.io.IOException

  Returns the message digest algorithm.
  Returns:
    The digest algorithm identifier.
  Throws:
    `java.io.IOException` - An I/O error occurred or the input is incorrectly encoded.

### verify

    public void verify()
                throws oracle.security.crypto.core.AuthenticationException,
                       java.io.IOException

  Verify the Message Digest.

  This method will always fail when reading a detached CMS `id-digestedData`. To process detached CMS Objects, use the `CMSDigestedDataContentInfo` instead.

  Throws:
    `oracle.security.crypto.core.AuthenticationException` - Message digest values are different.
    `java.io.IOException` - An I/O error occurred or no input has been read.
  See Also:
    `CMSContentInfo.inputInstance(InputStream)`, `CMSDigestedDataContentInfo`

### getEnclosedContentType

    public oracle.security.crypto.asn1.ASN1ObjectID getEnclosedContentType()
                                                                    throws java.io.IOException

  Returns the content type of the digested content.
  Specified by:
    `getEnclosedContentType` in class `CMSInputStream`
  Returns:
    The content type identifier.
  Throws:
    `java.io.IOException` - An I/O error occurred or no input has been read.

### read

    public int read()
             throws java.io.IOException

  Throws:
    `java.io.IOException`

### read

    public int read(byte[] buffer,
                    int offset,
                    int len)
             throws java.io.IOException

  Throws:
    `java.io.IOException`

### available

    public int available()
                  throws java.io.IOException

  Throws:
    `java.io.IOException`

### skip

    public long skip(long n)
              throws java.io.IOException

  Throws:
    `java.io.IOException`

### markSupported

    public boolean markSupported()

  Always returns `false</false>.`
  `Returns:`
    `false (not supported)`

### mark

    public void mark(int readlimit)

  Not supported.

### reset

    public void reset()
               throws java.io.IOException

  Not supported.
  Throws:
    `java.io.IOException` - always(not supported)

Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools CMS Java API Reference 10g Release 3 (10.1.3) B25377-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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