Oracle Security Developer Tools CMS Java API Reference
10g (10.1.4.0.1)

B28170-01


oracle.security.crypto.cms
Class CMSKEKRecipientInfo

java.lang.Object
  extended byoracle.security.crypto.cms.CMSRecipientInfo
      extended byoracle.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(oracle.security.crypto.core.SymmetricKey contentEncryptionKey, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionKeyAlgID, CMSKEKRecipientInfoSpec ri)
          Creates a CMSKEKRecipientInfo.
CMSKEKRecipientInfo(oracle.security.crypto.core.SymmetricKey contentEncryptionKey, CMSKEKRecipientInfoSpec ri)
          Creates a CMSKEKRecipientInfo.

 

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

CMSKEKRecipientInfo

public CMSKEKRecipientInfo(oracle.security.crypto.core.SymmetricKey contentEncryptionKey,
                           oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionKeyAlgID,
                           CMSKEKRecipientInfoSpec ri)
                    throws oracle.security.crypto.core.CipherException,
                           oracle.security.crypto.core.InvalidKeyException,
                           oracle.security.crypto.util.InvalidInputException,
                           oracle.security.crypto.core.AlgorithmIdentifierException
Creates a CMSKEKRecipientInfo.
Parameters:
contentEncryptionKey - The content encryption key.
contentEncryptionKeyAlgID - The content encrypton key algorithm
ri - The key encryption (wrap) information.
Throws:
oracle.security.crypto.core.CipherException - An error occurred during encryption.
oracle.security.crypto.core.InvalidKeyException - The encrytion key is invalid.
oracle.security.crypto.util.InvalidInputException - Input is invalid.
oracle.security.crypto.core.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 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 oracle.security.crypto.core.SymmetricKey getContentEncryptionKey(oracle.security.crypto.core.SymmetricKey keyDecryptionKey)
                                                                 throws oracle.security.crypto.core.AlgorithmIdentifierException,
                                                                        oracle.security.crypto.util.InvalidInputException,
                                                                        oracle.security.crypto.core.InvalidKeyException,
                                                                        oracle.security.crypto.core.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:
oracle.security.crypto.core.AlgorithmIdentifierException - The algorithm identifier contained in this RecipientInfo is not valid.
oracle.security.crypto.core.InvalidKeyException - The key decryption key could not be used.
oracle.security.crypto.core.CipherException - An error occured during decryption.
oracle.security.crypto.util.InvalidInputException - An error occurred.

getContentAuthenticationKey

public byte[] getContentAuthenticationKey(oracle.security.crypto.core.SymmetricKey keyDecryptionKey)
                                   throws oracle.security.crypto.core.AlgorithmIdentifierException,
                                          oracle.security.crypto.util.InvalidInputException,
                                          oracle.security.crypto.core.InvalidKeyException,
                                          oracle.security.crypto.core.CipherException
Returns the encryption key.
Returns:
The byte array containing the encryption key.
Throws:
oracle.security.crypto.core.AlgorithmIdentifierException - The algorithm identifier in the RecipientInfo is not valid.
oracle.security.crypto.core.InvalidKeyException - The key decryption key could not be used.
oracle.security.crypto.core.CipherException - An error occured during decryption.
oracle.security.crypto.util.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 (10.1.4.0.1)

B28170-01


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