Oracle Security Developer Tools CMS Java API Reference
10g Release 2 (10.1.2.0.2)

B15564-01


oracle.security.crypto.cms
Class CMSKEKRecipientInfo

java.lang.Object
  extended byoracle.security.crypto.cms.CMSRecipientInfo
      extended byoracle.security.crypto.cms.CMSKEKRecipientInfo


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(SymmetricKey contentEncryptionKey, AlgorithmIdentifier contentEncryptionKeyAlgID, CMSKEKRecipientInfoSpec ri)
Creates a CMSKEKRecipientInfo.
CMSKEKRecipientInfo(SymmetricKey contentEncryptionKey, CMSKEKRecipientInfoSpec ri)
Creates a CMSKEKRecipientInfo.

Method Summary
byte[] getContentAuthenticationKey(SymmetricKey keyDecryptionKey)
Returns the encryption key.
SymmetricKey getContentEncryptionKey(SymmetricKey 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.
AlgorithmIdentifier getKeyEncryptionAlgID()
Returns the key encryption (wrap) algorithm.
CMSKEKRecipientInfoSpec getRecipientInfoSpec()
Returns the CMSKEKRecipientInfoSpec object.
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(SymmetricKey contentEncryptionKey,
                           CMSKEKRecipientInfoSpec ri)
                    throws CipherException,
                           InvalidKeyException,
                           InvalidInputException,
                           AlgorithmIdentifierException
Creates a CMSKEKRecipientInfo.
Parameters:
contentEncryptionKey - The content encryption key.
ri - The key encryption (wrap) information.
Throws:
CipherException - An error occurred during encryption.
InvalidKeyException - The encrytion key is invalid.
InvalidInputException - Input is invalid.
AlgorithmIdentifierException - The algorithm is not supported.
See Also:
CMSKEKRecipientInfoSpec

CMSKEKRecipientInfo

public CMSKEKRecipientInfo(SymmetricKey contentEncryptionKey,
                           AlgorithmIdentifier contentEncryptionKeyAlgID,
                           CMSKEKRecipientInfoSpec ri)
                    throws CipherException,
                           InvalidKeyException,
                           InvalidInputException,
                           AlgorithmIdentifierException
Creates a CMSKEKRecipientInfo.
Parameters:
contentEncryptionKey - The content encryption key.
contentEncryptionKeyAlgID - The content encrypton key algorithm
ri - The key encryption (wrap) information.
Throws:
CipherException - An error occurred during encryption.
InvalidKeyException - The encrytion key is invalid.
InvalidInputException - Input is invalid.
AlgorithmIdentifierException - The algorithm is not supported.
See Also:
CMSKEKRecipientInfoSpec

Method Detail

getRecipientInfoSpec

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

getKeyEncryptionAlgID

public 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 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 SymmetricKey getContentEncryptionKey(SymmetricKey keyDecryptionKey)
                                     throws AlgorithmIdentifierException,
                                            InvalidInputException,
                                            InvalidKeyException,
                                            CipherException
Derives the content encryption key, by decryption the encrypted key stored in this object with the given key decryption key.
Parameters:
keyDecryptionKey - the key decryption key.
Throws:
AlgorithmIdentifierException - The algorithm identifier contained in this RecipientInfo is not valid.
InvalidKeyException - The key decryption key could not be used.
CipherException - An error occured during decryption.
InvalidInputException - An error occurred.

getContentAuthenticationKey

public byte[] getContentAuthenticationKey(SymmetricKey keyDecryptionKey)
                                   throws AlgorithmIdentifierException,
                                          InvalidInputException,
                                          InvalidKeyException,
                                          CipherException
Returns the encryption key.
Returns:
The byte array containing the encryption key.
Throws:
AlgorithmIdentifierException - The algorithm identifier in the RecipientInfo is not valid.
InvalidKeyException - The key decryption key could not be used.
CipherException - An error occured during decryption.
InvalidInputException - An error occurred.

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.
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.
Returns:
A string description of this object.

Oracle Security Developer Tools CMS Java API Reference
10g Release 2 (10.1.2.0.2)

B15564-01


Copyright © 2005 , Oracle. All rights reserved.