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 CMSSignedDataOutputStream

`java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
oracle.security.crypto.cms.CMSOutputStream
oracle.security.crypto.cms.CMSSignedDataOutputStream`

public class CMSSignedDataOutputStream
extends CMSOutputStream

A `CMSSignedDataOutputStream` writes its output in the form of a CMS `signed-data` structure, signing the data in the process.

Specifically, the effect of using this class is as if the following process took place:

- All of the data written to this stream is accumulated into a EncapsulatedContentInfo structure of the specified content-type.
- The resulting EncapsulatedContentInfo structure is then provided as the input to a ContentInfo structure of type `signed-data`.
- A BER encoding of the resulting ContentInfo structure is written to the underlying output stream;

except that the actual process is done in one pass, eliminating the necessity to accumulate all of the input data before writing any output.

In the case where a <ocde>CMSConnector is provided instead of a `CMSOutputStream`, only the exposed content i.e. the Content field of the ContentInfo structure minus the explicit [0] tag is written to the underlying output stream.

IMPORTANT: This class generates large CMS signed-data Objects more efficiently (Java VM memory usage) than the `CMSSignedDataContentInfo` class.

See Also:
  `CMSOutputStream`, `CMSSignedDataContentInfo`, `CMSSignedDataOutputStream`

Field Summary

Fields inherited from class java.io.FilterOutputStream
`out`

Constructor Summary
`CMSSignedDataOutputStream(CMSOutputConnector conn, java.util.Vector signers, java.util.Vector certificates, java.util.Vector crls, oracle.security.crypto.asn1.ASN1ObjectID contentType)` Creates a `CMSSignedDataOutputStream`.
`CMSSignedDataOutputStream(CMSOutputConnector conn, java.util.Vector signers, java.util.Vector certificates, java.util.Vector crls, oracle.security.crypto.asn1.ASN1ObjectID contentType, boolean createExternalSignatures)` Creates a `CMSSignedDataOutputStream`.
`CMSSignedDataOutputStream(java.io.OutputStream out, java.util.Vector signers, java.util.Vector certificates, java.util.Vector crls)` Creates a `CMSSignedDataOutputStream`.
`CMSSignedDataOutputStream(java.io.OutputStream out, java.util.Vector signers, java.util.Vector certificates, java.util.Vector crls, oracle.security.crypto.asn1.ASN1ObjectID contentType)` Creates a `CMSSignedDataOutputStream`.
`CMSSignedDataOutputStream(java.io.OutputStream out, java.util.Vector signers, java.util.Vector certificates, java.util.Vector crls, oracle.security.crypto.asn1.ASN1ObjectID contentType, boolean createExternalSignatures)` Creates a `CMSSignedDataOutputStream`.

Method Summary
`void` | `close()`
`oracle.security.crypto.asn1.ASN1ObjectID` | `getExposedContentType()` Returns the content type of the data that is output to the underlying output stream.
`void` | `terminate()` Finish writing the `signed-data` structure.
`void` | `write(byte[] b, int off, int len)`
`void` | `write(int ch)`

Methods inherited from class java.io.FilterOutputStream
`flush, write`

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

Constructor Detail

### CMSSignedDataOutputStream

    public CMSSignedDataOutputStream(java.io.OutputStream out,
                                     java.util.Vector signers,
                                     java.util.Vector certificates,
                                     java.util.Vector crls)
                              throws oracle.security.crypto.core.AlgorithmIdentifierException

  Creates a `CMSSignedDataOutputStream`.
Parameters:
  `out` - The underlying output stream.
  `signers` - A vector of `CMSSignerInfoSpec` objects.
  `certificates` - A list of Certificates that are to be added to the signed-data object.
  `crls` - A list of CRLs that are to be added to the signed-data object.
Throws:
  `oracle.security.crypto.core.AlgorithmIdentifierException` - If one of the signer-info objects has an invalid algorithm identifier.

### CMSSignedDataOutputStream

    public CMSSignedDataOutputStream(java.io.OutputStream out,
                                     java.util.Vector signers,
                                     java.util.Vector certificates,
                                     java.util.Vector crls,
                                     oracle.security.crypto.asn1.ASN1ObjectID contentType)
                              throws oracle.security.crypto.core.AlgorithmIdentifierException

  Creates a `CMSSignedDataOutputStream`.
Parameters:
  `out` - The underlying output stream.
  `signers` - A vector of `CMSSignerInfoSpec` objects.
  `certificates` - A list of Certificates that are to be added to the signed-data object.
  `crls` - A list of CRLs that are to be added to the signed-data object.
  `contentType` - The content type of the enclosed content.
Throws:
  `oracle.security.crypto.core.AlgorithmIdentifierException` - If one of the signer-info objects has an invalid algorithm identifier.

### CMSSignedDataOutputStream

    public CMSSignedDataOutputStream(java.io.OutputStream out,
                                     java.util.Vector signers,
                                     java.util.Vector certificates,
                                     java.util.Vector crls,
                                     oracle.security.crypto.asn1.ASN1ObjectID contentType,
                                     boolean createExternalSignatures)
                              throws oracle.security.crypto.core.AlgorithmIdentifierException

  Creates a `CMSSignedDataOutputStream`.
Parameters:
  `out` - The underlying output stream.
  `signers` - A vector of `CMSSignerInfoSpec` objects.
  `certificates` - A list of Certificates that are to be added to the signed-data object.
  `crls` - A list of CRLs that are to be added to the signed-data object.
  `contentType` - The content type of the enclosed content.
  `createExternalSignatures` - Set to `true` if the signatures are to be external.
Throws:
  `oracle.security.crypto.core.AlgorithmIdentifierException` - If one of the signer-info objects has an invalid algorithm identifier.

### CMSSignedDataOutputStream

    public CMSSignedDataOutputStream(CMSOutputConnector conn,
                                     java.util.Vector signers,
                                     java.util.Vector certificates,
                                     java.util.Vector crls,
                                     oracle.security.crypto.asn1.ASN1ObjectID contentType)
                              throws oracle.security.crypto.core.AlgorithmIdentifierException

  Creates a `CMSSignedDataOutputStream`.
Parameters:
  `conn` - The underlying output connector.
  `signers` - A vector of `CMSSignerInfoSpec` objects.
  `certificates` - A list of Certificates that are to be added to the signed-data object.
  `crls` - A list of CRLs that are to be added to the signed-data object.
  `contentType` - The content type of the enclosed content.
Throws:
  `oracle.security.crypto.core.AlgorithmIdentifierException` - If one of the signer-info objects has an invalid algorithm identifier.

### CMSSignedDataOutputStream

    public CMSSignedDataOutputStream(CMSOutputConnector conn,
                                     java.util.Vector signers,
                                     java.util.Vector certificates,
                                     java.util.Vector crls,
                                     oracle.security.crypto.asn1.ASN1ObjectID contentType,
                                     boolean createExternalSignatures)
                              throws oracle.security.crypto.core.AlgorithmIdentifierException

  Creates a `CMSSignedDataOutputStream`.
Parameters:
  `conn` - The underlying output connector.
  `signers` - A vector of `CMSSignerInfoSpec` objects.
  `certificates` - A list of Certificates that are to be added to the signed-data object.
  `crls` - A list of CRLs that are to be added to the signed-data object.
  `createExternalSignatures` - Set to true if the signatures are to be external.
  `contentType` - The content type of the enclosed content.
Throws:
  `oracle.security.crypto.core.AlgorithmIdentifierException` - If one of the signer-info objects has an invalid algorithm identifier.

Method Detail

### terminate

    public void terminate()
                   throws java.io.IOException

  Finish writing the `signed-data` structure.

  Do not call this method before all the data has been written to the output stream.

  Specified by:
    `terminate` in class `CMSOutputStream`
  Throws:
    `java.io.IOException` - If an I/O error occurs.

### write

    public void write(int ch)
               throws java.io.IOException

  Throws:
    `java.io.IOException`

### write

    public void write(byte[] b,
                      int off,
                      int len)
               throws java.io.IOException

  Throws:
    `java.io.IOException`

### close

    public void close()
               throws java.io.IOException

  Throws:
    `java.io.IOException`

### getExposedContentType

    public oracle.security.crypto.asn1.ASN1ObjectID getExposedContentType()

  Returns the content type of the data that is output to the underlying output stream.
  Specified by:
    `getExposedContentType` in class `CMSOutputStream`
  Returns:
    The content type identifier.

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.