Oracle Security Developer Tools CMS Java API Reference
10g Release 2 (10.1.2.0.2)

B15564-01


oracle.security.crypto.cms
Class CMSInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended byoracle.security.crypto.cms.CMSInputStream

Direct Known Subclasses:
CMSAuthenticatedDataInputStream, CMSCompressedDataInputStream, CMSDigestedDataInputStream, CMSEncryptedDataInputStream, CMSEnvelopedDataInputStream, CMSSignedDataInputStream

public abstract class CMSInputStream
extends java.io.FilterInputStream

This abstract class is the superclass of all classes that implement an input stream filter for reading CMS Objects. A CMSInputStream reads its input in the form of a CMS ContentInfo structure in one pass, eliminating the necessity to accumulate all of the input data.

In the case where a CMSInputConnector is provided instead of an input stream, it expects the Content field of the CMS ContentInfo structure i.e. the underlying input stream must be positioned just after the explicit [0] tag wrapper.

NOTE: The CMSInputStream class allows you to read detached CMS objects but you will not be able to verify the signature, digest or authentication code of the detached CMS Object. Please use the CMSContentInfo to process detached CMS Objects.

IMPORTANT: This class processes large CMS Objects more efficiently (Java VM memory usage) than the CMSContentInfo class.

See Also:
CMSContentInfo.input(java.io.InputStream), CMSContentInfo.inputInstance(java.io.InputStream), CMSInputConnector

Field Summary

Fields inherited from class java.io.FilterInputStream
in

Constructor Summary
CMSInputStream(java.io.InputStream in)
Creates a CMSInputStream.

Method Summary
abstract ASN1ObjectID getEnclosedContentType()
Returns the content type of the underlying content.
abstract void terminate()
Ensures that the CMS Object in the input stream has been completely read.

Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip

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

Constructor Detail

CMSInputStream

public CMSInputStream(java.io.InputStream in)
Creates a CMSInputStream.
Parameters:
in - The underlying input stream.

Method Detail

getEnclosedContentType

public abstract ASN1ObjectID getEnclosedContentType()
                                             throws java.io.IOException
Returns the content type of the underlying content.
Returns:
The content type identifier.
Throws:
An - I/O error occurred or the input encoding is incorrect.
java.io.IOException

terminate

public abstract void terminate()
                        throws java.io.IOException
Ensures that the CMS Object in the input stream has been completely read.

Must be called after all the content enclosed by the CMS Object has been read.

Throws:
java.io.IOException - There is still some unread underlying content in the input stream or an I/O error occurred.

Oracle Security Developer Tools CMS Java API Reference
10g Release 2 (10.1.2.0.2)

B15564-01


Copyright © 2005 , Oracle. All rights reserved.