Skip navigation links

Oracle Fusion Middleware CMS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10667-03


oracle.security.crypto.cms
Class CMSKEKRecipientInfo

java.lang.Object
  extended by oracle.security.crypto.cms.CMSRecipientInfo
      extended by oracle.security.crypto.cms.CMSKEKRecipientInfo

All Implemented Interfaces:
oracle.security.crypto.asn1.ASN1Object, oracle.security.crypto.util.Streamable

public class CMSKEKRecipientInfo
extends CMSRecipientInfo

This class encapsulates recipient information using the symmetric key encryption (wrapping) key exchange mechanism.

Please note that mixed key encryption and content encryption algorithms are not supported.

Please be aware that using the otherKeyAttribute field of the KEKIdentifier structure can cause interoperability problems. To process the otherKeyAttribute field, use the oracle.security.crypto.asn1 package.

See Also:
CMSRecipientInfo, CMSKEKRecipientInfoSpec

Constructor Summary
CMSKEKRecipientInfo()
          Creates an empty CMSKEKRecipientInfo.
CMSKEKRecipientInfo(byte[] contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID, CMSKEKRecipientInfoSpec ri)
          Creates a CMSKEKRecipientInfo.
CMSKEKRecipientInfo(javax.crypto.SecretKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionKeyAlgID, CMSKEKRecipientInfoSpec ri)
          Creates a CMSKEKRecipientInfo.
CMSKEKRecipientInfo(javax.crypto.SecretKey contentEncryptionKey, CMSKEKRecipientInfoSpec ri)
          Creates a CMSKEKRecipientInfo.

 

Method Summary
 java.lang.String getContentAuthenticationAlgID()
           
 byte[] getContentAuthenticationKey(javax.crypto.SecretKey keyDecryptionKey)
          Returns the encryption key.
 javax.crypto.SecretKey getContentEncryptionKey(javax.crypto.SecretKey keyDecryptionKey)
          Derives the content encryption key, by decryption the encrypted key stored in this object with the given key decryption key.
 byte[] getEncryptedKey()
          Returns the encrypted key.
 oracle.security.crypto.core.AlgorithmIdentifier getKeyEncryptionAlgID()
          Returns the key encryption (wrap) algorithm.
 CMSKEKRecipientInfoSpec getRecipientInfoSpec()
          Returns the CMSKEKRecipientInfoSpec object.
 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.
protected  void inputRecipientInfo(java.io.InputStream is)
          Reads the CMSRecipientInfo structure.
 int length()
          Returns the length of this object's encoding.
 void output(java.io.OutputStream os)
          Write this object's encoding to the specified output stream.
 java.lang.String toString()
          Returns a brief text description of this object.

 

Methods inherited from class oracle.security.crypto.cms.CMSRecipientInfo
input, inputInstance

 

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

 

Constructor Detail

CMSKEKRecipientInfo

public CMSKEKRecipientInfo()
Creates an empty CMSKEKRecipientInfo.

CMSKEKRecipientInfo

public CMSKEKRecipientInfo(byte[] contentEncryptionKey,
                           oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID,
                           CMSKEKRecipientInfoSpec ri)
                    throws java.security.InvalidKeyException,
                           javax.crypto.BadPaddingException,
                           javax.crypto.IllegalBlockSizeException,
                           javax.crypto.NoSuchPaddingException,
                           java.security.NoSuchAlgorithmException,
                           java.security.InvalidAlgorithmParameterException,
                           java.security.spec.InvalidKeySpecException
Creates a CMSKEKRecipientInfo.
Parameters:
contentEncryptionKey - The content encryption key bytes.
contentEncryptionAlgID - The content Encryption algorithm identifier
ri - The key encryption (wrap) information.
Throws:
java.security.InvalidKeyException - The encrytion key is invalid.
javax.crypto.NoSuchPaddingException - Padding mechanism not supported
java.security.NoSuchAlgorithmException - Algorithm Not supported
javax.crypto.BadPaddingException - Expected padding in the input not found
javax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
java.security.spec.InvalidKeySpecException - The key specifications not valid
java.security.InvalidAlgorithmParameterException - The algorithm parameters not valid

CMSKEKRecipientInfo

public CMSKEKRecipientInfo(javax.crypto.SecretKey contentEncryptionKey,
                           CMSKEKRecipientInfoSpec ri)
                    throws java.security.InvalidKeyException,
                           oracle.security.crypto.util.InvalidInputException,
                           java.security.NoSuchAlgorithmException,
                           javax.crypto.BadPaddingException,
                           javax.crypto.IllegalBlockSizeException,
                           javax.crypto.NoSuchPaddingException,
                           java.security.InvalidAlgorithmParameterException,
                           java.security.spec.InvalidKeySpecException
Creates a CMSKEKRecipientInfo.

Note the changes in the Method signature

Previously public CMSKEKRecipientInfo (SymmetricKey , CMSKEKRecipientInfoSpec )

Nowpublic CMSKEKRecipientInfo (SecretKey , CMSKEKRecipientInfoSpec )

Note the changes in exceptions Exceptions no longer thrown -- CipherException ,AlgorithmIdentifierException Exceptions introduced -- NoSuchAlgorithmException , BadPaddingException , IllegalBlockSizeException,NoSuchPaddingException, InvalidAlgorithmParameterException,InvalidKeySpecException

Parameters:
contentEncryptionKey - The content encryption key.
ri - The key encryption (wrap) information.
Throws:
java.security.InvalidKeyException - The encrytion key is invalid.
oracle.security.crypto.util.InvalidInputException - Input is invalid.
javax.crypto.NoSuchPaddingException - Padding mechanism not supported
java.security.NoSuchAlgorithmException - Algorithm Not supported
javax.crypto.BadPaddingException - Expected padding in the input not found
javax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
java.security.spec.InvalidKeySpecException - The key specifications not valid
java.security.InvalidAlgorithmParameterException - The algorithm parameters not valid
See Also:
CMSKEKRecipientInfoSpec

CMSKEKRecipientInfo

public CMSKEKRecipientInfo(javax.crypto.SecretKey contentEncryptionKey,
                           oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionKeyAlgID,
                           CMSKEKRecipientInfoSpec ri)
                    throws java.security.InvalidKeyException,
                           oracle.security.crypto.util.InvalidInputException,
                           java.security.NoSuchAlgorithmException,
                           javax.crypto.IllegalBlockSizeException,
                           javax.crypto.BadPaddingException,
                           javax.crypto.NoSuchPaddingException,
                           java.security.InvalidAlgorithmParameterException,
                           java.security.spec.InvalidKeySpecException
Creates a CMSKEKRecipientInfo.

Note the changes in the Method signature

Previously public CMSKEKRecipientInfo (SymmetricKey ,AlgorithmIdentifier , CMSKEKRecipientInfoSpec )

Nowpublic CMSKEKRecipientInfo (SecretKey ,AlgorithmIdentifier , CMSKEKRecipientInfoSpec )

Note the changes in exceptions Exceptions no longer thrown -- CipherException ,AlgorithmIdentifierException Exceptions introduced -- NoSuchAlgorithmException , BadPaddingException , IllegalBlockSizeException,NoSuchPaddingException, InvalidAlgorithmParameterException,InvalidKeySpecException

Parameters:
contentEncryptionKey - The content encryption key.
contentEncryptionKeyAlgID - The content encrypton key algorithm
ri - The key encryption (wrap) information.
Throws:
java.security.InvalidKeyException - The encrytion key is invalid.
oracle.security.crypto.util.InvalidInputException - Input is invalid.
javax.crypto.NoSuchPaddingException - Padding mechanism not supported
java.security.NoSuchAlgorithmException - Algorithm Not supported
javax.crypto.BadPaddingException - Expected padding in the input not found
javax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
java.security.spec.InvalidKeySpecException - The key specifications not valid
java.security.InvalidAlgorithmParameterException - The algorithm parameters not valid
See Also:
CMSKEKRecipientInfoSpec

Method Detail

getContentAuthenticationAlgID

public java.lang.String getContentAuthenticationAlgID()

getRecipientInfoSpec

public CMSKEKRecipientInfoSpec getRecipientInfoSpec()
Returns the CMSKEKRecipientInfoSpec object.
Returns:
The CMSKEKRecipientInfoSpec object.

getKeyEncryptionAlgID

public oracle.security.crypto.core.AlgorithmIdentifier getKeyEncryptionAlgID()
Returns the key encryption (wrap) algorithm.
Returns:
The wrapping algorithm identifier.

getEncryptedKey

public byte[] getEncryptedKey()
Returns the encrypted key.
Returns:
The encrypted key.

getVersionNumber

public java.math.BigInteger getVersionNumber()
Returns the version number.
Returns:
The version number.

getVersion

public oracle.security.crypto.asn1.ASN1Integer getVersion()
Deprecated. As of Phaos CMS 2.0.1, replaced by getVersionNumber()
Returns the version number.
Specified by:
getVersion in class CMSRecipientInfo
Returns:
The version number.

getContentEncryptionKey

public javax.crypto.SecretKey getContentEncryptionKey(javax.crypto.SecretKey keyDecryptionKey)
                                               throws oracle.security.crypto.util.InvalidInputException,
                                                      java.security.InvalidKeyException,
                                                      java.security.NoSuchAlgorithmException,
                                                      javax.crypto.BadPaddingException,
                                                      javax.crypto.IllegalBlockSizeException,
                                                      javax.crypto.NoSuchPaddingException,
                                                      java.security.InvalidAlgorithmParameterException,
                                                      java.security.spec.InvalidKeySpecException
Derives the content encryption key, by decryption the encrypted key stored in this object with the given key decryption key.

Note the changes in the Method signature

Previously public SymmetricKey getContentEncryptionKey (SymmetricKey )

Now public SecretKey getContentEncryptionKey (SecretKey )

Note the changes in exceptions Exceptions no longer thrown -- CipherException ,AlgorithmIdentifierException Exceptions introduced -- NoSuchAlgorithmException , BadPaddingException , IllegalBlockSizeException,NoSuchPaddingException, InvalidAlgorithmParameterException,InvalidKeySpecException

Parameters:
keyDecryptionKey - the key decryption key.
Throws:
java.security.InvalidKeyException - The key decryption key could not be used.
oracle.security.crypto.util.InvalidInputException - An error occurred.
javax.crypto.NoSuchPaddingException - Padding mechanism not supported
java.security.NoSuchAlgorithmException - Algorithm Not supported
javax.crypto.BadPaddingException - Expected padding in the input not found
javax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
java.security.spec.InvalidKeySpecException - The key specifications not valid
java.security.InvalidAlgorithmParameterException - The algorithm parameters not valid

getContentAuthenticationKey

public byte[] getContentAuthenticationKey(javax.crypto.SecretKey keyDecryptionKey)
                                   throws oracle.security.crypto.util.InvalidInputException,
                                          java.security.InvalidKeyException,
                                          java.security.NoSuchAlgorithmException,
                                          javax.crypto.BadPaddingException,
                                          javax.crypto.IllegalBlockSizeException,
                                          javax.crypto.NoSuchPaddingException,
                                          java.security.InvalidAlgorithmParameterException,
                                          java.security.spec.InvalidKeySpecException
Returns the encryption key.

Note the changes in the Method signature

Previously public SymmetricKey getContentAuthenticationKey (SymmetricKey )

Now public SecretKey getContentAuthenticationKey (SecretKey )

Note the changes in exceptions Exceptions no longer thrown -- CipherException ,AlgorithmIdentifierException Exceptions introduced -- NoSuchAlgorithmException , BadPaddingException , IllegalBlockSizeException,NoSuchPaddingException, InvalidAlgorithmParameterException,InvalidKeySpecException

Parameters:
keyDecryptionKey - the key decryption key.
Returns:
The byte array containing the encryption key.
Throws:
java.security.InvalidKeyException - The key decryption key could not be used.
oracle.security.crypto.util.InvalidInputException - An error occurred.
javax.crypto.NoSuchPaddingException - Padding mechanism not supported
java.security.NoSuchAlgorithmException - Algorithm Not supported
javax.crypto.BadPaddingException - Expected padding in the input not found
javax.crypto.IllegalBlockSizeException - Invalid Block size (Cipher)
java.security.spec.InvalidKeySpecException - The key specifications not valid
java.security.InvalidAlgorithmParameterException - The algorithm parameters not valid

inputRecipientInfo

protected void inputRecipientInfo(java.io.InputStream is)
                           throws java.io.IOException
Description copied from class: CMSRecipientInfo
Reads the CMSRecipientInfo structure. This method must be implemented by subclasses.

The input stream is positioned at the beginning of the tag octet of the SEQUENCE encoding.

Specified by:
inputRecipientInfo in class CMSRecipientInfo
Parameters:
is - The input stream.
Throws:
java.io.IOException - The encoding is incorrect or an I/O error occurs.

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Write this object's encoding to the specified output stream.
Parameters:
out - The output stream.
Throws:
java.io.IOException - An I/O error occurred.

length

public int length()
Returns the length of this object's encoding.
Returns:
The length in bytes.

toString

public java.lang.String toString()
Returns a brief text description of this object.
Overrides:
toString in class java.lang.Object
Returns:
A string description of this object.

Skip navigation links

Oracle Fusion Middleware CMS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10667-03


Copyright © 2005, 2011 , Oracle. All rights reserved.