|
Oracle Fusion Middleware CMS Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10667-05 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
oracle.security.crypto.cms.CMSOutputStream
oracle.security.crypto.cms.CMSEncryptedDataOutputStream
public class CMSEncryptedDataOutputStream
A CMSEncryptedDataOutputStream
writes its output in the form of a CMS encrypted-data
structure, encrypting the data in the process.
Specifically, the effect of using this class is as if the following process took place:
encrypted-data
.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 encrypted-data Objects more efficiently (Java VM memory usage) than the CMSEncryptedDataContentInfo
class.
CMSOutputStream
, CMSEncryptedDataContentInfo
, CMSEncryptedDataOutputConnector
Field Summary |
---|
Fields inherited from class java.io.FilterOutputStream |
---|
out |
Constructor Summary | |
---|---|
CMSEncryptedDataOutputStream(CMSOutputConnector conn, javax.crypto.SecretKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID, oracle.security.crypto.asn1.ASN1ObjectID enclosedContentType) Creates a CMSEncryptedDataOutputStream . |
|
CMSEncryptedDataOutputStream(CMSOutputConnector conn, javax.crypto.SecretKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID, oracle.security.crypto.asn1.ASN1ObjectID enclosedContentType, oracle.security.crypto.cert.AttributeSet unprotectedAttributes) Creates a CMSEncryptedDataOutputStream . |
|
CMSEncryptedDataOutputStream(CMSOutputConnector conn, javax.crypto.SecretKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID, oracle.security.crypto.asn1.ASN1ObjectID enclosedContentType, oracle.security.crypto.cert.AttributeSet unprotectedAttributes, boolean writeEncryptedOutput) Creates a CMSEncryptedDataOutputStream . |
|
CMSEncryptedDataOutputStream(java.io.OutputStream out, javax.crypto.SecretKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID, oracle.security.crypto.asn1.ASN1ObjectID enclosedContentType) Creates a CMSEncryptedDataOutputStream . |
|
CMSEncryptedDataOutputStream(java.io.OutputStream out, javax.crypto.SecretKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID, oracle.security.crypto.asn1.ASN1ObjectID enclosedContentType, oracle.security.crypto.cert.AttributeSet unprotectedAttributes) Creates a CMSEncryptedDataOutputStream . |
|
CMSEncryptedDataOutputStream(java.io.OutputStream out, javax.crypto.SecretKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID, oracle.security.crypto.asn1.ASN1ObjectID enclosedContentType, oracle.security.crypto.cert.AttributeSet unprotectedAttributes, boolean writeEncryptedOutput) Creates a CMSEncryptedDataOutputStream . |
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 encrypted-data structure to the underlying output stream. |
void |
write(byte[] b, int offset, 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 |
---|
public CMSEncryptedDataOutputStream(java.io.OutputStream out, javax.crypto.SecretKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID, oracle.security.crypto.asn1.ASN1ObjectID enclosedContentType) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException
CMSEncryptedDataOutputStream
.
Note the changes in the Method signature
Previouslypublic CMSEncryptedDataOutputStream (OutputStream , SymmetricKey, AlgorithmIdentifier, ASN1ObjectID )
Nowpublic CMSEncryptedDataOutputStream (OutputStream , SecretKey , AlgorithmIdentifier , ASN1ObjectID )
Note the changes in exceptions Exceptions no longer thrown -- AlgorithmIdentifierException Exceptions included -- NoSuchAlgorithmException
out
- The underlying output stream.contentEncryptionKey
- The content encryption key.contentEncryptionAlgID
- The content encryption algorithm.enclosedContentType
- The content type of the enclosed content.AlgorithmIdentifierException
- The encryption algorithm is not supported.java.security.InvalidKeyException
- The encryption key is invalid.java.security.NoSuchAlgorithmException
public CMSEncryptedDataOutputStream(java.io.OutputStream out, javax.crypto.SecretKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID, oracle.security.crypto.asn1.ASN1ObjectID enclosedContentType, oracle.security.crypto.cert.AttributeSet unprotectedAttributes) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException
CMSEncryptedDataOutputStream
.
Note the changes in the Method signature
Previouslypublic CMSEncryptedDataOutputStream (OutputStream , SymmetricKey , AlgorithmIdentifier , ASN1ObjectID ,AttributeSet )
Nowpublic CMSEncryptedDataOutputStream (OutputStream , SecretKey , AlgorithmIdentifier , ASN1ObjectID,AttributeSet )
Note the changes in exceptions Exceptions no longer thrown -- AlgorithmIdentifierException Exceptions included -- NoSuchAlgorithmException
out
- The underlying output stream.contentEncryptionKey
- The content encryption key.contentEncryptionAlgID
- The content encryption algorithm.enclosedContentType
- The content type of the enclosed content.unprotectedAttributes
- The set of unprotected attributes.java.security.NoSuchAlgorithmException
- The encryption algorithm is not supported.java.security.InvalidKeyException
- The encryption key is invalid.public CMSEncryptedDataOutputStream(java.io.OutputStream out, javax.crypto.SecretKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID, oracle.security.crypto.asn1.ASN1ObjectID enclosedContentType, oracle.security.crypto.cert.AttributeSet unprotectedAttributes, boolean writeEncryptedOutput) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException
CMSEncryptedDataOutputStream
.
Note the changes in the Method signature
Previouslypublic CMSEncryptedDataOutputStream (OutputStream , SymmetricKey , AlgorithmIdentifier , ASN1ObjectID ,AttributeSet,boolean )
Nowpublic CMSEncryptedDataOutputStream (OutputStream , SecretKey , AlgorithmIdentifier , ASN1ObjectID,AttributeSet,boolean )
Note the changes in exceptions Exceptions no longer thrown -- AlgorithmIdentifierException Exceptions included -- NoSuchAlgorithmException
out
- The underlying output stream.contentEncryptionKey
- The content encryption key.contentEncryptionAlgID
- The content encryption algorithm.enclosedContentType
- The content type of the enclosed content.unprotectedAttributes
- The set of unprotected attributes.writeEncryptedOutput
- If true
the encryptedContent will be written to the output stream; false
otherwise.java.security.NoSuchAlgorithmException
- The encryption algorithm is not supported.java.security.InvalidKeyException
- The encryption key is invalid.public CMSEncryptedDataOutputStream(CMSOutputConnector conn, javax.crypto.SecretKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID, oracle.security.crypto.asn1.ASN1ObjectID enclosedContentType) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException
CMSEncryptedDataOutputStream
.
Note the changes in the Method signature
Previouslypublic CMSEncryptedDataOutputStream (CMSOutputConnector , SymmetricKey , AlgorithmIdentifier , ASN1ObjectID )
Nowpublic CMSEncryptedDataOutputStream (CMSOutputConnector , SecretKey , AlgorithmIdentifier , ASN1ObjectID )
Note the changes in exceptions Exceptions no longer thrown -- AlgorithmIdentifierException Exceptions included -- NoSuchAlgorithmException
conn
- The underlying output connector.contentEncryptionKey
- The content encryption key.contentEncryptionAlgID
- The content encryption algorithm.enclosedContentType
- The content type of the enclosed content.java.security.NoSuchAlgorithmException
- The encryption algorithm is not supported.java.security.InvalidKeyException
- The encryption key is invalid.public CMSEncryptedDataOutputStream(CMSOutputConnector conn, javax.crypto.SecretKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID, oracle.security.crypto.asn1.ASN1ObjectID enclosedContentType, oracle.security.crypto.cert.AttributeSet unprotectedAttributes) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException
CMSEncryptedDataOutputStream
.
Note the changes in the Method signature
Previouslypublic CMSEncryptedDataOutputStream (CMSOutputConnector , SymmetricKey , AlgorithmIdentifier , ASN1ObjectID, AttributeSet )
Nowpublic CMSEncryptedDataOutputStream (CMSOutputConnector , SecretKey , AlgorithmIdentifier , ASN1ObjectID, AttributeSet )
Note the changes in exceptions Exceptions no longer thrown -- AlgorithmIdentifierException Exceptions included -- NoSuchAlgorithmException
conn
- The underlying output connector.contentEncryptionKey
- The content encryption key.contentEncryptionAlgID
- The content encryption algorithm.enclosedContentType
- The content type of the enclosed content.unprotectedAttributes
- The set of unprotected attributes.java.security.NoSuchAlgorithmException
- The encryption algorithm is not supported.java.security.InvalidKeyException
- The encryption key is invalid.public CMSEncryptedDataOutputStream(CMSOutputConnector conn, javax.crypto.SecretKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID, oracle.security.crypto.asn1.ASN1ObjectID enclosedContentType, oracle.security.crypto.cert.AttributeSet unprotectedAttributes, boolean writeEncryptedOutput) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException
CMSEncryptedDataOutputStream
.
Note the changes in the Method signature
Previouslypublic CMSEncryptedDataOutputStream (CMSOutputConnector , SymmetricKey , AlgorithmIdentifier , ASN1ObjectID, AttributeSet ,boolean)
Nowpublic CMSEncryptedDataOutputStream (CMSOutputConnector , SecretKey , AlgorithmIdentifier , ASN1ObjectID, AttributeSet ,boolean)
Note the changes in exceptions Exceptions no longer thrown -- AlgorithmIdentifierException Exceptions included -- NoSuchAlgorithmException
conn
- The underlying output connector.contentEncryptionKey
- The content encryption key.contentEncryptionAlgID
- The content encryption algorithm.enclosedContentType
- The content type of the enclosed content.unprotectedAttributes
- The set of unprotected attributes.writeEncryptedOutput
- If true
the encryptedContent will be written to the output stream; false
otherwise.java.security.NoSuchAlgorithmException
- The encryption algorithm is not supported.java.security.InvalidKeyException
- The encryption key is invalid.Method Detail |
---|
public void terminate() throws java.io.IOException
encrypted-data
structure to the underlying output stream.
Must be called only after all the enclosed data has been written to this output stream.
terminate
in class CMSOutputStream
java.io.IOException
- An I/O error occurred.public void write(int ch) throws java.io.IOException
write
in class java.io.FilterOutputStream
java.io.IOException
public void write(byte[] b, int offset, int len) throws java.io.IOException
write
in class java.io.FilterOutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.FilterOutputStream
java.io.IOException
public oracle.security.crypto.asn1.ASN1ObjectID getExposedContentType()
getExposedContentType
in class CMSOutputStream
|
Oracle Fusion Middleware CMS Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10667-05 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |