|
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.CMSAuthenticatedDataOutputStream
public class CMSAuthenticatedDataOutputStream
A CMSAuthenticatedDataOutputStream
writes its output in the form of a CMS authenticated-data
structure, generating the message authentication code in the process.
Specifically, the effect of using this class is as if the following process took place:
authenticated-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.
Please be aware that the HMAC key is stored in a RecipientInfo structure. If you decide to use the Key Encryption (CMSKEKRecipientInfo
) key management mechanism, the HMAC key used must be a TripleDES or RC2 key.
IMPORTANT: This class generates large CMS authenticated-data Objects more efficiently (Java VM memory usage) than the CMSAuthenticatedDataContentInfo
class.
CMSOutputStream
, CMSAuthenticatedDataContentInfo
, CMSAuthenticatedDataOutputConnector
Field Summary |
---|
Fields inherited from class java.io.FilterOutputStream |
---|
out |
Constructor Summary | |
---|---|
CMSAuthenticatedDataOutputStream(CMSOutputConnector conn, OriginatorInfo origInfo, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.core.AlgorithmIdentifier digestAlgID, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, oracle.security.crypto.cert.AttributeSet authenticatedAttribs, oracle.security.crypto.cert.AttributeSet unauthenticatedAttribs, javax.crypto.SecretKey hmacKey, oracle.security.crypto.core.AlgorithmIdentifier hmacKeyAlgID, boolean detachEncapContent) Creates a CMSAuthenticatedDataOutputStream . |
|
CMSAuthenticatedDataOutputStream(CMSOutputConnector conn, OriginatorInfo origInfo, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.core.AlgorithmIdentifier digestAlgID, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, oracle.security.crypto.cert.AttributeSet authenticatedAttribs, oracle.security.crypto.cert.AttributeSet unauthenticatedAttribs, javax.crypto.SecretKey hmacKey, boolean detachEncapContent) Creates a CMSAuthenticatedDataOutputStream . |
|
CMSAuthenticatedDataOutputStream(CMSOutputConnector conn, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, javax.crypto.SecretKey hmacKey, boolean detachEncapContent) Creates a CMSAuthenticatedDataOutputStream . |
|
CMSAuthenticatedDataOutputStream(java.io.OutputStream out, OriginatorInfo origInfo, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.core.AlgorithmIdentifier digestAlgID, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, oracle.security.crypto.cert.AttributeSet authenticatedAttribs, oracle.security.crypto.cert.AttributeSet unauthenticatedAttribs, javax.crypto.SecretKey hmacKey, oracle.security.crypto.core.AlgorithmIdentifier hmacKeyAlgID, boolean detachEncapContent) Creates a CMSAuthenticatedDataOutputStream . |
|
CMSAuthenticatedDataOutputStream(java.io.OutputStream out, OriginatorInfo origInfo, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.core.AlgorithmIdentifier digestAlgID, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, oracle.security.crypto.cert.AttributeSet authenticatedAttribs, oracle.security.crypto.cert.AttributeSet unauthenticatedAttribs, javax.crypto.SecretKey hmacKey, boolean detachEncapContent) Creates a CMSAuthenticatedDataOutputStream . |
|
CMSAuthenticatedDataOutputStream(java.io.OutputStream out, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, javax.crypto.SecretKey hmacKey, oracle.security.crypto.core.AlgorithmIdentifier hmacKeyAlgID, boolean detachEncapContent) Creates a CMSAuthenticatedDataOutputStream . |
|
CMSAuthenticatedDataOutputStream(java.io.OutputStream out, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, javax.crypto.SecretKey hmacKey, boolean detachEncapContent) Creates a CMSAuthenticatedDataOutputStream . |
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 authenticated-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 |
---|
public CMSAuthenticatedDataOutputStream(java.io.OutputStream out, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, javax.crypto.SecretKey hmacKey, boolean detachEncapContent) throws oracle.security.crypto.util.InvalidInputException, java.security.NoSuchAlgorithmException
CMSAuthenticatedDataOutputStream
.
Note the changes in the Method signature
Previously public CMSAuthenticatedDataOutputStream(OutputStream , Vector , AlgorithmIdentifier ,ASN1ObjectID , SymmetricKey ,boolean )
Nowpublic CMSAuthenticatedDataOutputStream(OutputStream , Vector , AlgorithmIdentifier ,ASN1ObjectID , SecretKey ,boolean )
Note the changes in the exceptions thrown
Exceptions not thrown - AlgorithmIdentifierException
Exceptions included - NoSuchAlgorithmException
out
- The underlying output stream.recipients
- The recipients (each element must be an instance of CMSRecipientInfoSpec
).macAlgorithm
- The HMAC Algorithm.encapContentType
- The content type of data being authenticated.hmacKey
- The HMAC key.detachEncapContent
- If true
the authenticated content is not written to the underlying output stream; false
otherwise.java.security.NoSuchAlgorithmException
- Algorithm is not supported.oracle.security.crypto.util.InvalidInputException
- Input appears to be invalid.public CMSAuthenticatedDataOutputStream(java.io.OutputStream out, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, javax.crypto.SecretKey hmacKey, oracle.security.crypto.core.AlgorithmIdentifier hmacKeyAlgID, boolean detachEncapContent) throws oracle.security.crypto.util.InvalidInputException, java.security.NoSuchAlgorithmException
CMSAuthenticatedDataOutputStream
. p>Note the changes in the Method signature
Previously public CMSAuthenticatedDataOutputStream(OutputStream , Vector , AlgorithmIdentifier, ASN1ObjectID , SymmetricKey ,AlgorithmIdentifier,boolean )
Nowpublic CMSAuthenticatedDataOutputStream(OutputStream , Vector , AlgorithmIdentifier, ASN1ObjectID , SecretKey ,AlgorithmIdentifier,boolean )
Note the changes in the exceptions thrown
Exceptions not thrown - AlgorithmIdentifierException
Exceptions included - NoSuchAlgorithmException
out
- The underlying output stream.recipients
- The recipients (each element must be an instance of CMSRecipientInfoSpec
).macAlgorithm
- The HMAC Algorithm.encapContentType
- The content type of data being authenticated.hmacKey
- The HMAC key.detachEncapContent
- If true
the authenticated content is not written to the underlying output stream; false
otherwise.java.security.NoSuchAlgorithmException
- Algorithm is not supported.oracle.security.crypto.util.InvalidInputException
- Input appears to be invalid.public CMSAuthenticatedDataOutputStream(java.io.OutputStream out, OriginatorInfo origInfo, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.core.AlgorithmIdentifier digestAlgID, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, oracle.security.crypto.cert.AttributeSet authenticatedAttribs, oracle.security.crypto.cert.AttributeSet unauthenticatedAttribs, javax.crypto.SecretKey hmacKey, boolean detachEncapContent) throws oracle.security.crypto.util.InvalidInputException, java.security.NoSuchAlgorithmException
CMSAuthenticatedDataOutputStream
.
Note the changes in the Method signature
Previously public CMSAuthenticatedDataOutputStream(OutputStream , OriginatorInfo , Vector , AlgorithmIdentifier , AlgorithmIdentifier , ASN1ObjectID ,AttributeSet , AttributeSet , SymmetricKey,boolean)
Nowpublic CMSAuthenticatedDataOutputStream(OutputStream , OriginatorInfo , Vector , AlgorithmIdentifier , AlgorithmIdentifier , ASN1ObjectID ,AttributeSet , AttributeSet , SecretKey,boolean)
Note the changes in the exceptions thrown
Exceptions not thrown - AlgorithmIdentifierException
Exceptions included - NoSuchAlgorithmException
out
- The underlying output stream.origInfo
- The Originator Info.recipients
- The recipients (each element must be an instance of CMSRecipientInfoSpec
).macAlgorithm
- The HMAC Algorithm.digestAlgID
- The digest algorithm.encapContentType
- The content type of data being authenticated.authenticatedAttribs
- The set of Authenticated Attributes.unauthenticatedAttribs
- The set of Unauthenticated Attributes.hmacKey
- The HMAC key.detachEncapContent
- If true
the authenticated content is not written to the underlying output stream; false
otherwise.java.security.NoSuchAlgorithmException
- Algorithm is not supported.oracle.security.crypto.util.InvalidInputException
- Input appears to be invalid.public CMSAuthenticatedDataOutputStream(java.io.OutputStream out, OriginatorInfo origInfo, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.core.AlgorithmIdentifier digestAlgID, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, oracle.security.crypto.cert.AttributeSet authenticatedAttribs, oracle.security.crypto.cert.AttributeSet unauthenticatedAttribs, javax.crypto.SecretKey hmacKey, oracle.security.crypto.core.AlgorithmIdentifier hmacKeyAlgID, boolean detachEncapContent) throws oracle.security.crypto.util.InvalidInputException, java.security.NoSuchAlgorithmException
CMSAuthenticatedDataOutputStream
.
Note the changes in the Method signature
Previously public CMSAuthenticatedDataOutputStream(OutputStream , OriginatorInfo , Vector , AlgorithmIdentifier , AlgorithmIdentifier , ASN1ObjectID ,AttributeSet , AttributeSet , SymmetricKey ,AlgorithmIdentifier ,boolean )
Now public CMSAuthenticatedDataOutputStream(OutputStream , OriginatorInfo , Vector , AlgorithmIdentifier , AlgorithmIdentifier , ASN1ObjectID ,AttributeSet , AttributeSet , SecretKey ,AlgorithmIdentifier ,boolean )
Note the changes in the exceptions thrown
Exceptions not thrown - AlgorithmIdentifierException
Exceptions included - NoSuchAlgorithmException
out
- The underlying output stream.origInfo
- The Originator Info.recipients
- The recipients (each element must be an instance of CMSRecipientInfoSpec
).macAlgorithm
- The HMAC Algorithm.digestAlgID
- The digest algorithm.encapContentType
- The content type of data being authenticated.authenticatedAttribs
- The set of Authenticated Attributes.unauthenticatedAttribs
- The set of Unauthenticated Attributes.hmacKey
- The HMAC key.hmacKeyAlgID
- The HMAC key algorithm.detachEncapContent
- If true
the authenticated content is not written to the underlying output stream; false
otherwise.java.security.NoSuchAlgorithmException
- Algorithm is not supported.oracle.security.crypto.util.InvalidInputException
- Input appears to be invalid.public CMSAuthenticatedDataOutputStream(CMSOutputConnector conn, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, javax.crypto.SecretKey hmacKey, boolean detachEncapContent) throws oracle.security.crypto.util.InvalidInputException, java.security.NoSuchAlgorithmException
CMSAuthenticatedDataOutputStream
.
Note the changes in the Method signature
Previously public CMSAuthenticatedDataOutputStream(CMSOutputConnector , Vector , AlgorithmIdentifier , ASN1ObjectID , SymmetricKey ,boolean )
Now public CMSAuthenticatedDataOutputStream(CMSOutputConnector , Vector , AlgorithmIdentifier , ASN1ObjectID , SecretKey ,boolean )
Note the changes in the exceptions thrown
Exceptions not thrown - AlgorithmIdentifierException
Exceptions included - NoSuchAlgorithmException
out
- The underlying output stream.origInfo
- The Originator Info.recipients
- The recipients (each element must be an instance of CMSRecipientInfoSpec
).macAlgorithm
- The HMAC Algorithm.encapContentType
- The content type of data being authenticated.authenticatedAttribs
- The set of Authenticated Attributes.unauthenticatedAttribs
- The set of Unauthenticated Attributes.hmacKey
- The HMAC key.detachEncapContent
- If true
the authenticated content is not written to the underlying output stream; false
otherwise.java.security.NoSuchAlgorithmException
- Algorithm is not supported.oracle.security.crypto.util.InvalidInputException
- Input appears to be invalid.public CMSAuthenticatedDataOutputStream(CMSOutputConnector conn, OriginatorInfo origInfo, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.core.AlgorithmIdentifier digestAlgID, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, oracle.security.crypto.cert.AttributeSet authenticatedAttribs, oracle.security.crypto.cert.AttributeSet unauthenticatedAttribs, javax.crypto.SecretKey hmacKey, boolean detachEncapContent) throws oracle.security.crypto.util.InvalidInputException, java.security.NoSuchAlgorithmException
CMSAuthenticatedDataOutputStream
.
Note the changes in the Method signature
Previously public CMSAuthenticatedDataOutputStream(CMSOutputConnector , OriginatorInfo , Vector , AlgorithmIdentifier , AlgorithmIdentifier, ASN1ObjectID , AttributeSet , AttributeSet , SymmetricKey , boolean )
Nowpublic CMSAuthenticatedDataOutputStream(CMSOutputConnector , OriginatorInfo , Vector , AlgorithmIdentifier , AlgorithmIdentifier, ASN1ObjectID , AttributeSet , AttributeSet , SecretKey , boolean )
Note the changes in the exceptions thrown
Exceptions not thrown - AlgorithmIdentifierException
Exceptions included - NoSuchAlgorithmException
conn
- The underlying output connector.origInfo
- The Originator Info.recipients
- The recipients (each element must be an instance of CMSRecipientInfoSpec
).macAlgorithm
- The HMAC Algorithm.digestAlgID
- The digest algorithm.encapContentType
- The content type of data being authenticated.authenticatedAttribs
- The set of Authenticated Attributes.unauthenticatedAttribs
- The set of Unauthenticated Attributes.hmacKey
- The HMAC key.detachEncapContent
- If true
the authenticated content is not written to the underlying output stream; false
otherwise.java.security.NoSuchAlgorithmException
- Algorithm is not supported.oracle.security.crypto.util.InvalidInputException
- Input appears to be invalid.public CMSAuthenticatedDataOutputStream(CMSOutputConnector conn, OriginatorInfo origInfo, java.util.Vector recipients, oracle.security.crypto.core.AlgorithmIdentifier macAlgorithm, oracle.security.crypto.core.AlgorithmIdentifier digestAlgID, oracle.security.crypto.asn1.ASN1ObjectID encapContentType, oracle.security.crypto.cert.AttributeSet authenticatedAttribs, oracle.security.crypto.cert.AttributeSet unauthenticatedAttribs, javax.crypto.SecretKey hmacKey, oracle.security.crypto.core.AlgorithmIdentifier hmacKeyAlgID, boolean detachEncapContent) throws oracle.security.crypto.util.InvalidInputException, java.security.NoSuchAlgorithmException
CMSAuthenticatedDataOutputStream
.
Note the changes in the Method signature public CMSAuthenticatedDataOutputStream(CMSOutputConnector , OriginatorInfo , Vector , AlgorithmIdentifier , AlgorithmIdentifier, ASN1ObjectID , AttributeSet , AttributeSets, SymmetricKey , AlgorithmIdentifier ,boolean )
Nowpublic CMSAuthenticatedDataOutputStream(CMSOutputConnector , OriginatorInfo , Vector , AlgorithmIdentifier , AlgorithmIdentifier, ASN1ObjectID , AttributeSet , AttributeSet , SecretKey , boolean )
Note the changes in the exceptions thrown
Exceptions not thrown - AlgorithmIdentifierException
Exceptions included - NoSuchAlgorithmException
conn
- The underlying output connector.origInfo
- The Originator Info.recipients
- The recipients (each element must be an instance of CMSRecipientInfoSpec
).macAlgorithm
- The HMAC Algorithm.digestAlgID
- The digest algorithm.encapContentType
- The content type of data being authenticated.authenticatedAttribs
- The set of Authenticated Attributes.unauthenticatedAttribs
- The set of Unauthenticated Attributes.hmacKey
- The HMAC key.hmacKeyAlgID
- The HMAC key algorithm.detachEncapContent
- If true
the authenticated content is not written to the underlying output stream; false
otherwise.NoSuchAlgorithmIdentifierException
- Algorithm is not supported.oracle.security.crypto.util.InvalidInputException
- Input appears to be invalid.java.security.NoSuchAlgorithmException
Method Detail |
---|
public void terminate() throws java.io.IOException
authenticated-data
structure.
This method must be called only after all the authenticated data has been written.
terminate
in class CMSOutputStream
java.io.IOException
- An I/O error ocuurs.public void write(int ch) throws java.io.IOException
write
in class java.io.FilterOutputStream
java.io.IOException
public void write(byte[] b, int off, 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 |