|
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
oracle.security.crypto.cms.CMSContentInfo
oracle.security.crypto.cms.CMSEnvelopedDataContentInfo
public class CMSEnvelopedDataContentInfo
This class encapsulates a CMS object of content type enveloped-data.
| Constructor Summary | |
|---|---|
CMSEnvelopedDataContentInfo()Creates an empty CMSEnvelopedDataContentInfo. |
|
CMSEnvelopedDataContentInfo(CMSContentInfo contentInfo, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID)Creates a CMSEnvelopedDataContentInfo. |
|
CMSEnvelopedDataContentInfo(java.io.InputStream is)Creates a CMSEnvelopedDataContentInfo object, by reading a BER encoding from the specified input stream. |
|
| Method Summary | |
|---|---|
void |
addRecipient(oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID, javax.crypto.SecretKey keyEncryptionKey, byte[] keyIdentifier, java.util.Date keyDate, oracle.security.crypto.asn1.ASN1Sequence otherKeyAttribute)Add a recipient. |
void |
addRecipient(CMSRecipientInfoSpec ris)Add a recipient. |
void |
addRecipient(java.security.cert.X509Certificate recipientCert, oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID)Add a recipient. |
void |
addRecipient(java.security.cert.X509Certificate recipientCert, oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID, boolean useSPKI64)Add a recipient. |
boolean |
equals(java.lang.Object obj)Indicates whether some other object is "equal to" this one. |
oracle.security.crypto.core.AlgorithmIdentifier |
getContentEncryptionAlgID()Returns the content encryption algorithm. |
CMSContentInfo |
getEnclosed(java.security.PrivateKey privateKey, java.security.cert.X509Certificate recipientCert)Returns the enclosed content after decryption. |
CMSContentInfo |
getEnclosed(javax.crypto.SecretKey symmetricKey, byte[] keyIdentifier)Returns the enclosed content after decryption. |
CMSContentInfo |
getEnclosed(javax.crypto.SecretKey symmetricKey, byte[] keyIdentifier, java.util.Date keyDate)Returns the enclosed content after decryption. |
CMSContentInfo |
getEnclosed(javax.crypto.SecretKey symmetricKey, byte[] keyIdentifier, java.util.Date keyDate, oracle.security.crypto.asn1.ASN1Sequence otherKeyAttribute)Returns the enclosed content after decryption. |
oracle.security.crypto.asn1.ASN1ObjectID |
getEnclosedContentType()Returns the content type of the encrypted content. |
byte[] |
getEncryptedContent()Returns the enclosed content which is encrypted. |
protected byte[] |
getExposedContent()Returns the contents octets of the DER encoding of the content field of this CMS object. |
OriginatorInfo |
getOriginatorInfo()Returns the OriginatorInfo. |
oracle.security.crypto.cert.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. |
int |
hashCode()Returns a hash code value for this object. |
protected void |
inputContent(java.io.InputStream is)Initializes this object by reading the Content field of the CMS ContentInfo structure i.e. |
boolean |
isDetached()Indicates if the encrypted content is not present. |
java.util.Enumeration |
recipients()Returns the list of message recipients. |
void |
setEnclosed(byte[] encryptedContent)Sets the Encrypted Content. |
protected void |
setExposedContent(byte[] expContent)Returns the contents octets of the DER encoding of the content field of this CMS object. |
void |
setOriginatorInfo(OriginatorInfo origInfo)Sets the OriginatorInfo. |
void |
setUnprotectedAttribs(oracle.security.crypto.cert.AttributeSet unprotectedAttributes)Set the unprotected attributes. |
java.lang.String |
toString()Returns a brief text description of this object. |
protected void |
update()Clears the internal output cache. |
void |
writeDetached(boolean writeDetached)Indicate if the encrypted content must be omitted from this object's output encoding. |
| Methods inherited from class oracle.security.crypto.cms.CMSContentInfo |
|---|
computeDigest, contentTypeName, getContentType, input, inputInstance, isDegenerate, length, output |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CMSEnvelopedDataContentInfo()
CMSEnvelopedDataContentInfo.
public CMSEnvelopedDataContentInfo(CMSContentInfo contentInfo,
oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID)
throws java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
javax.crypto.BadPaddingException,
javax.crypto.IllegalBlockSizeException
CMSEnvelopedDataContentInfo.
Note the changes in exceptions Exceptions not thrown -- CipherException,AlgorithmIdentifierException Exceptions included -- NoSuchAlgorithmException,NoSuchPaddingException,BadPaddingException, IllegalBlockSizeException
contentInfo - The document to encrypt.contentEncryptionAlgID - The content encryption algorithm.javax.crypto.NoSuchPaddingException - Padding mechanism not supportedjava.security.NoSuchAlgorithmException - Algorithm Not supportedjavax.crypto.BadPaddingException - Expected padding in the input not foundjavax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
public CMSEnvelopedDataContentInfo(java.io.InputStream is)
throws java.io.IOException
CMSEnvelopedDataContentInfo object, by reading a BER encoding from the specified input stream.
is - The input stream.java.io.IOException - If the input is not correctly formatted, has the wrong content type, or an I/O error occurs while reading from the input stream.| Method Detail |
|---|
public boolean isDetached()
isDetached in class CMSContentInfotrue the encrypted content is not present; false otherwise.protected void setExposedContent(byte[] expContent)
CMSContentInfosetExposedContent in class CMSContentInfoCMSContentInfo.isDetached()protected byte[] getExposedContent()
CMSContentInfogetExposedContent in class CMSContentInfonull for a detached CMS object.CMSContentInfo.isDetached()public java.math.BigInteger getVersionNumber()
public oracle.security.crypto.asn1.ASN1Integer getVersion()
getVersionNumber()public oracle.security.crypto.asn1.ASN1ObjectID getEnclosedContentType()
public oracle.security.crypto.core.AlgorithmIdentifier getContentEncryptionAlgID()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Enumeration recipients()
CMSRecipientInfo objects.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objecttrue if this object is the same as the obj argument; false otherwise.public void writeDetached(boolean writeDetached)
writeDetached - true if the encrypted content is to be omitted from this object's encoded output; false otherwise.CMSContentInfo.isDetached()public void setEnclosed(byte[] encryptedContent)
encryptedContent - The encrypted CMSContentInfo.
public void addRecipient(java.security.cert.X509Certificate recipientCert,
oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID)
throws java.security.cert.CertificateEncodingException,
java.io.IOException,
java.security.NoSuchAlgorithmException,
javax.crypto.BadPaddingException,
javax.crypto.IllegalBlockSizeException,
java.security.InvalidKeyException,
javax.crypto.NoSuchPaddingException
Uses the Key Transport Recipient Information with IssuerAndSerialNumber as the Recipient Identifier.
Note the changes in the Method signature
Previouslypublic void addRecipient (X509 , AlgorithmIdentifier )
Nowpublic void addRecipient (X509Certificate , AlgorithmIdentifier )
Note the changes in exceptions Exceptions no longer thrown --AlgorithmIdentifierException,CipherException Exceptions included -- CertificateEncodingException,IOException,NoSuchAlgorithmException,BadPaddingException, IllegalBlockSizeException,NoSuchPaddingException
recipientCert - The recipient's public key certificate.keyEncryptionAlgID - The key encipherment algorithm.java.security.InvalidKeyException - Invalid content encryption key.javax.crypto.NoSuchPaddingException - Padding mechanism not supportedjava.security.NoSuchAlgorithmException - Algorithm Not supportedjavax.crypto.BadPaddingException - Expected padding in the input not foundjavax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)java.security.cert.CertificateEncodingException - Specifies an encoding errorjava.io.IOException - Input/Output Exception while instantiating X509 from an inputstream
public void addRecipient(java.security.cert.X509Certificate recipientCert,
oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID,
boolean useSPKI64)
throws java.security.NoSuchAlgorithmException,
javax.crypto.BadPaddingException,
java.security.InvalidKeyException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.NoSuchPaddingException
Uses the Key Transport Recipient Information with Subject Key Identifier as the Recipient Identifier.
Note the changes in the Method signature
Previouslypublic void addRecipient (X509 , AlgorithmIdentifier ,boolean )
Nowpublic void addRecipient (X509Certificate , AlgorithmIdentifier ,boolean )
Note the changes in exceptions Exceptions no longer thrown --AlgorithmIdentifierException,CipherException Exceptions included -- NoSuchAlgorithmException,BadPaddingException, IllegalBlockSizeException,NoSuchPaddingException
recipientCert - The recipient's public key certificate.keyEncryptionAlgID - The key encipherment algorithm.useSPKI64 - Uses Subject Public Key Identifier as the recipient identifier. true use 64 bit PKI; false use 160 bit SPKI.java.security.InvalidKeyException - Invalid content encryption key.javax.crypto.NoSuchPaddingException - Padding mechanism not supportedjava.security.NoSuchAlgorithmException - Algorithm Not supportedjavax.crypto.BadPaddingException - Expected padding in the input not foundjavax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
public void addRecipient(CMSRecipientInfoSpec ris)
throws java.security.NoSuchAlgorithmException,
oracle.security.crypto.util.InvalidInputException,
java.security.InvalidKeyException,
javax.crypto.BadPaddingException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.NoSuchPaddingException,
java.security.spec.InvalidKeySpecException,
java.security.InvalidAlgorithmParameterException
Uses the Key Encryption Key Recipient Information.
Note the changes in exceptions Exceptions no longer thrown --AlgorithmIdentifierException,CipherException Exceptions included -- NoSuchAlgorithmException,BadPaddingException,IllegalBlockSizeException, NoSuchPaddingException,InvalidKeySpecException,InvalidAlgorithmParameterException
ris - The recipient's information.oracle.security.crypto.util.InvalidInputException - Unrecognized RecipientInfoSpec.java.security.InvalidKeyException - Invalid content encryption key.javax.crypto.NoSuchPaddingException - Padding mechanism not supportedjava.security.NoSuchAlgorithmException - Algorithm Not supportedjavax.crypto.BadPaddingException - Expected padding in the input not foundjavax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)java.security.spec.InvalidKeySpecException - The key specifications not validjava.security.InvalidAlgorithmParameterException - The algorithm parameters not valid
public void addRecipient(oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID,
javax.crypto.SecretKey keyEncryptionKey,
byte[] keyIdentifier,
java.util.Date keyDate,
oracle.security.crypto.asn1.ASN1Sequence otherKeyAttribute)
throws java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException,
oracle.security.crypto.util.InvalidInputException,
java.security.spec.InvalidKeySpecException,
java.security.InvalidAlgorithmParameterException,
javax.crypto.NoSuchPaddingException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException
Uses the Key Encryption Key Recipient Information.
Note the changes in the Method signature
Previouslypublic void addRecipient (AlgorithmIdentifier , SymmetricKey , byte[] , Date , ASN1Sequence )
Nowpublic void addRecipient (AlgorithmIdentifier , SecretKey , byte[] , Date , ASN1Sequence )
Note the changes in exceptions Exceptions no longer thrown --AlgorithmIdentifierException,CipherException Exceptions included -- NoSuchAlgorithmException,BadPaddingException,IllegalBlockSizeException, NoSuchPaddingException,InvalidKeySpecException,InvalidAlgorithmParameterException
ri - A CMSKEKRecipientInfoSpec containing the recipient information.java.security.InvalidKeyException - Invalid content encryption key.oracle.security.crypto.util.InvalidInputException - Unrecognized RecipientInfoSpec.javax.crypto.NoSuchPaddingException - Padding mechanism not supportedjava.security.NoSuchAlgorithmException - Algorithm Not supportedjavax.crypto.BadPaddingException - Expected padding in the input not foundjavax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)java.security.spec.InvalidKeySpecException - The key specifications not validjava.security.InvalidAlgorithmParameterException - The algorithm parameters not valid
public CMSContentInfo getEnclosed(java.security.PrivateKey privateKey,
java.security.cert.X509Certificate recipientCert)
throws java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException,
UnknownRecipientException,
oracle.security.crypto.util.InvalidInputException,
java.security.cert.CertificateEncodingException,
java.io.IOException,
javax.crypto.NoSuchPaddingException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException
Assumes that Key Transport Recipient Information is used.
Note the changes in the Method signature
Previouslypublic CMSContentInfo getEnclosed (oracle.security.crypto.core.PrivateKey , X509)
Nowpublic CMSContentInfo getEnclosed (java.security.PrivateKey , X509Certificate)
Note the changes in exceptions Exceptions no longer thrown --AlgorithmIdentifierException,CipherException Exceptions included -- NoSuchAlgorithmException,CertificateEncodingException, IOException,NoSuchPaddingException,IllegalBlockSizeException,BadPaddingException
java.security.InvalidKeyException - Invalid content encryption key.UnknownRecipientException - The decryption key does belong to the recipient.oracle.security.crypto.util.InvalidInputException - If an incorrect encoding or I/O error occurred.javax.crypto.NoSuchPaddingException - Padding mechanism not supportedjava.security.NoSuchAlgorithmException - Algorithm Not supportedjavax.crypto.BadPaddingException - Expected padding in the input not foundjavax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)java.security.cert.CertificateEncodingException - Specifies an encoding errorjava.io.IOException - Input/Output Exception while instantiating X509 from an inputstream
public CMSContentInfo getEnclosed(javax.crypto.SecretKey symmetricKey,
byte[] keyIdentifier)
throws java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException,
UnknownRecipientException,
oracle.security.crypto.util.InvalidInputException,
javax.crypto.BadPaddingException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidAlgorithmParameterException,
java.security.spec.InvalidKeySpecException
Assumes that Key Encryption Key Recipient Information is used.
Note the changes in the Method signature
Previouslypublic CMSContentInfo getEnclosed (SymmetricKey, byte[] )
Nowpublic CMSContentInfo getEnclosed (SecretKey, byte[] )
Note the changes in exceptions Exceptions no longer thrown --AlgorithmIdentifierException,CipherException Exceptions included -- NoSuchAlgorithmException,NoSuchPaddingException,IllegalBlockSizeException, BadPaddingException,InvalidAlgorithmParameterException,InvalidKeySpecException
symmetricKey - The previously distributed symmetric key.keyIdentifier - Key identifier.java.security.InvalidKeyException - Invalid content encryption key.UnknownRecipientException - The decryption key does belong to the recipient.oracle.security.crypto.util.InvalidInputException - If an incorrect encoding or I/O error occurred.javax.crypto.NoSuchPaddingException - Padding mechanism not supportedjava.security.NoSuchAlgorithmException - Algorithm Not supportedjavax.crypto.BadPaddingException - Expected padding in the input not foundjavax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)java.security.spec.InvalidKeySpecException - The key specifications not validjava.security.InvalidAlgorithmParameterException - The algorithm parameters not valid
public CMSContentInfo getEnclosed(javax.crypto.SecretKey symmetricKey,
byte[] keyIdentifier,
java.util.Date keyDate)
throws java.security.InvalidKeyException,
UnknownRecipientException,
oracle.security.crypto.util.InvalidInputException,
java.security.NoSuchAlgorithmException,
javax.crypto.BadPaddingException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidAlgorithmParameterException,
java.security.spec.InvalidKeySpecException
Assumes that Key Encryption Key Recipient Information is used.
Note the changes in the Method signature
Previouslypublic CMSContentInfo getEnclosed (SymmetricKey, byte[] ,Date)
Nowpublic CMSContentInfo getEnclosed (SecretKey, byte[],Date )
Note the changes in exceptions Exceptions no longer thrown --AlgorithmIdentifierException,CipherException Exceptions included -- NoSuchAlgorithmException,NoSuchPaddingException,IllegalBlockSizeException, BadPaddingException,InvalidAlgorithmParameterException,InvalidKeySpecException
symmetricKey - The previously distributed symmetric key.keyIdentifier - Key identifier.keyDate - Key generation date.java.security.InvalidKeyException - Invalid content encryption key.UnknownRecipientException - The decryption key does belong to the recipient.oracle.security.crypto.util.InvalidInputException - If an incorrect encoding or I/O error occurred.javax.crypto.NoSuchPaddingException - Padding mechanism not supportedjava.security.NoSuchAlgorithmException - Algorithm Not supportedjavax.crypto.BadPaddingException - Expected padding in the input not foundjavax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)java.security.spec.InvalidKeySpecException - The key specifications not validjava.security.InvalidAlgorithmParameterException - The algorithm parameters not valid
public CMSContentInfo getEnclosed(javax.crypto.SecretKey symmetricKey,
byte[] keyIdentifier,
java.util.Date keyDate,
oracle.security.crypto.asn1.ASN1Sequence otherKeyAttribute)
throws java.security.InvalidKeyException,
UnknownRecipientException,
oracle.security.crypto.util.InvalidInputException,
java.security.NoSuchAlgorithmException,
javax.crypto.BadPaddingException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidAlgorithmParameterException,
java.security.spec.InvalidKeySpecException
Assumes that Key Encryption Key Recipient Information is used.
Note the changes in the Method signature
Previouslypublic CMSContentInfo getEnclosed (SymmetricKey, byte[] ,Date , ASN1Sequence)
Nowpublic CMSContentInfo getEnclosed (SecretKey, byte[],Date ,ASN1Sequence)
Note the changes in exceptions Exceptions no longer thrown --AlgorithmIdentifierException,CipherException Exceptions included -- NoSuchAlgorithmException,NoSuchPaddingException,IllegalBlockSizeException, BadPaddingException,InvalidAlgorithmParameterException,InvalidKeySpecException
symmetricKey - The previously distributed symmetric key.keyIdentifier - Key identifier.keyDate - Key generation date.otherKeyAttribute - The Other Key Attribute.java.security.InvalidKeyException - Invalid content encryption key.UnknownRecipientException - The decryption key does belong to the recipient.oracle.security.crypto.util.InvalidInputException - If an incorrect encoding or I/O error occurred.javax.crypto.NoSuchPaddingException - Padding mechanism not supportedjava.security.NoSuchAlgorithmException - Algorithm Not supportedjavax.crypto.BadPaddingException - Expected padding in the input not foundjavax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)java.security.spec.InvalidKeySpecException - The key specifications not validjava.security.InvalidAlgorithmParameterException - The algorithm parameters not valid
protected void inputContent(java.io.InputStream is)
throws java.io.IOException
CMSContentInfoThis method must be implemented by subclasses. It is unlikely that package users will ever need to call it directly.
inputContent in class CMSContentInfojava.io.IOExceptionpublic byte[] getEncryptedContent()
public void setOriginatorInfo(OriginatorInfo origInfo)
Do not use this method if PKCS#7 v1.5 interoperability is required.
origInfo - The OriginatorInfo.public OriginatorInfo getOriginatorInfo()
OriginatorInfo if present or null otherwise.public void setUnprotectedAttribs(oracle.security.crypto.cert.AttributeSet unprotectedAttributes)
unprotectedAttributes - The unprotected attributes.public oracle.security.crypto.cert.AttributeSet getUnprotectedAttribs()
null otherwise.protected void update()
update in class CMSContentInfo
|
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 | |||||||