public class CMSEnvelopedDataInputStream extends CMSInputStream
CMSEnvelopedDataInputStream is used to read enveloped-data CMS objects.
A CMSEnvelopedDataInputStream is essentially a input stream filter that unwraps the CMS enveloped-data structure from the data read in.
IMPORTANT: This class processes large CMS enveloped-data Objects more efficiently (Java VM memory usage) than the CMSEnvelopedDataContentInfo class.
| Constructor and Description |
|---|
CMSEnvelopedDataInputStream(CMSInputConnector conn, java.security.PrivateKey recipientPrivateKey, java.security.cert.X509Certificate recipientCert)
Creates a
CMSEnvelopedDataInputStream. |
CMSEnvelopedDataInputStream(CMSInputConnector conn, javax.crypto.SecretKey keyEncryptionKey)
Creates a
CMSEnvelopedDataInputStream. |
CMSEnvelopedDataInputStream(java.io.InputStream in, java.security.PrivateKey recipientPrivateKey, java.security.cert.X509Certificate recipientCert)
Creates a
CMSEnvelopedDataInputStream. |
CMSEnvelopedDataInputStream(java.io.InputStream in, javax.crypto.SecretKey keyEncryptionKey)
Creates a
CMSEnvelopedDataInputStream. |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
oracle.security.crypto.core.AlgorithmIdentifier |
getContentEncryptionAlgID()
Returns the content encryption algorithm.
|
oracle.security.crypto.asn1.ASN1ObjectID |
getEnclosedContentType()
Returns the content type of the encrypted content.
|
OriginatorInfo |
getOrginatorInfo()
Returns the OriginatorInfo.
|
AttributeSet |
getUnprotectedAttribs()
Returns the unprotected attributes.
|
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
enveloped-data structure. |
public CMSEnvelopedDataInputStream(java.io.InputStream in,
java.security.PrivateKey recipientPrivateKey,
java.security.cert.X509Certificate recipientCert)
throws java.security.NoSuchAlgorithmException,
java.security.cert.CertificateEncodingException,
java.io.IOException
CMSEnvelopedDataInputStream.
Note the changes in the Method signature
Previously public CMSEnvelopedDataInputStream (InputStream , oracle.security.crypto.core.PrivateKey , X509 )
Nowpublic CMSEnvelopedDataInputStream (InputStream , java.security.PrivateKey , X509Certificate )
Note the changes in exceptions Exceptions introduced -- IOException,CertificateEncodingException,NoSuchAlgorithmException
in - The underlying input stream.recipientPrivateKey - The private key of the recipient.recipientCert - The recipient's certificate.java.security.NoSuchAlgorithmException - Algorithm Not supportedjava.security.cert.CertificateEncodingException - Specifies an encoding errorjava.io.IOException - Input/Output Exception while instantiating X509 from an inputstreampublic CMSEnvelopedDataInputStream(CMSInputConnector conn, java.security.PrivateKey recipientPrivateKey, java.security.cert.X509Certificate recipientCert) throws java.io.IOException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateEncodingException
CMSEnvelopedDataInputStream.
Note the changes in the Method signature
Previously public CMSEnvelopedDataInputStream (CMSInputConnector , oracle.security.crypto.core.PrivateKey , X509 )
Nowpublic CMSEnvelopedDataInputStream (CMSInputConnector , java.security.PrivateKey , X509Certificate )
Note the changes in exceptions Exceptions introduced -- IOException,CertificateEncodingException,NoSuchAlgorithmException
conn - The underlying input connector.recipientPrivateKey - The private key of the recipient.recipientCert - The recipient's certificate.java.security.NoSuchAlgorithmException - Algorithm Not supportedjava.security.cert.CertificateEncodingException - Specifies an encoding errorjava.io.IOException - Input/Output Exception while instantiating X509 from an inputstreampublic CMSEnvelopedDataInputStream(java.io.InputStream in,
javax.crypto.SecretKey keyEncryptionKey)
CMSEnvelopedDataInputStream.
Note the changes in the Method signature
Previously public CMSEnvelopedDataInputStream (InputStream, SymmetricKey )
Nowpublic CMSEnvelopedDataInputStream (InputStream, SecretKey )
in - The underlying input stream.keyEncryptionKey - The key used for key encipherment.public CMSEnvelopedDataInputStream(CMSInputConnector conn, javax.crypto.SecretKey keyEncryptionKey)
CMSEnvelopedDataInputStream.
Note the changes in the Method signature
Previously public CMSEnvelopedDataInputStream (CMSInputConnector, SymmetricKey )
Nowpublic CMSEnvelopedDataInputStream (CMSInputConnector, SecretKey )
in - The underlying input connector.keyEncryptionKey - The key used for key encipherment.public void terminate()
throws java.io.IOException
enveloped-data structure.
This method must be called only after all the enclosed data has been read.
terminate in class CMSInputStreamjava.io.IOException - If the encoding is incorrect or an I/O error occurs.public int read()
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read(byte[] buffer,
int offset,
int len)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class java.io.FilterInputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.FilterInputStreamjava.io.IOExceptionpublic boolean markSupported()
false</false>.Overrides:markSupported in class java.io.FilterInputStreampublic void mark(int readlimit)
mark in class java.io.FilterInputStreampublic void reset()
throws java.io.IOException
reset in class java.io.FilterInputStreamjava.io.IOException - alwayspublic java.math.BigInteger getVersionNumber()
throws java.io.IOException
java.io.IOException - An I/O error occurred or the input is incorrectly encoded.public oracle.security.crypto.asn1.ASN1Integer getVersion()
throws java.io.IOException
getVersionNumber()java.io.IOException - If the encoding is incorrect or an I/O error occurs.public OriginatorInfo getOrginatorInfo() throws java.io.IOException
java.io.IOException - If the encoding is incorrect or an I/O error occurs.public AttributeSet getUnprotectedAttribs() throws java.io.IOException
java.io.IOException - If the encoding is incorrect or an I/O error occurs.public oracle.security.crypto.asn1.ASN1ObjectID getEnclosedContentType()
throws java.io.IOException
getEnclosedContentType in class CMSInputStreamjava.io.IOException - If the encoding is incorrect or an I/O error occurs.public oracle.security.crypto.core.AlgorithmIdentifier getContentEncryptionAlgID()
throws java.io.IOException
java.io.IOException - If the encoding is incorrect or an I/O error occurs.