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

B28170-01


oracle.security.crypto.cms
Class CMSKeyTransRecipientInfo

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

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

public class CMSKeyTransRecipientInfo
extends CMSRecipientInfo

This class encapsulates recipient information using the Key Transport key exchange mechanism.

See Also:
CMSRecipientInfo, CMSKeyTransRecipientInfoSpec

Constructor Summary
CMSKeyTransRecipientInfo()
          Creates an empty CMSKeyTransRecipientInfo.
CMSKeyTransRecipientInfo(byte[] hmacKey, oracle.security.crypto.core.PublicKey keyEncryptionKey, byte[] spki, oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID)
          Creates a CMSKeyTransRecipientInfo.
CMSKeyTransRecipientInfo(byte[] hmacKey, oracle.security.crypto.core.PublicKey keyEncryptionKey, oracle.security.crypto.cert.IssuerAndSerialNo iasn, oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID)
          Creates a CMSKeyTransRecipientInfo.
CMSKeyTransRecipientInfo(java.io.InputStream is)
          Creates a CMSKeyTransRecipientInfo by reading the BER encoding from the specified input stream.
CMSKeyTransRecipientInfo(oracle.security.crypto.core.SymmetricKey contentEncryptionKey, oracle.security.crypto.core.PublicKey keyEncryptionKey, byte[] spki, oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID)
          Creates a CMSKeyTransRecipientInfo.
CMSKeyTransRecipientInfo(oracle.security.crypto.core.SymmetricKey contentEncryptionKey, oracle.security.crypto.core.PublicKey keyEncryptionKey, oracle.security.crypto.cert.IssuerAndSerialNo iasn, oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID)
          Creates a CMSKeyTransRecipientInfo.

 

Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 byte[] getContentAuthenticationKey(oracle.security.crypto.core.PrivateKey keyDecryptionKey)
          Derives the content authentication key, by decryption the encrypted key stored in this object with the given key decryption key.
 oracle.security.crypto.core.SymmetricKey getContentEncryptionKey(oracle.security.crypto.core.PrivateKey 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 content encryption key.
 oracle.security.crypto.cert.IssuerAndSerialNo getIASN()
          Returns the IssuerAndSerialNo recipient identifier.
 oracle.security.crypto.cert.X500Name getIssuer()
          Returns the issuer of the recipient's certificate.
 oracle.security.crypto.core.AlgorithmIdentifier getKeyEncryptionAlgID()
          Returns the Key Wrapping or Encipherment Algorithm.
 java.math.BigInteger getSerialNo()
          Returns the serial number of the recipient's certificate.
 byte[] getSPKI()
          Returns the Subject Public Key Identifier.
 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 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)
          Output this object's encoding to the specified output stream.
 java.lang.String toString()
          A brief textual description of this object.
 boolean useSPKI64()
          Indicated if SPKI is being used as the Recipient Identifier.

 

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

 

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

 

Constructor Detail

CMSKeyTransRecipientInfo

public CMSKeyTransRecipientInfo()
Creates an empty CMSKeyTransRecipientInfo.

CMSKeyTransRecipientInfo

public CMSKeyTransRecipientInfo(oracle.security.crypto.core.SymmetricKey contentEncryptionKey,
                                oracle.security.crypto.core.PublicKey keyEncryptionKey,
                                oracle.security.crypto.cert.IssuerAndSerialNo iasn,
                                oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID)
                         throws oracle.security.crypto.core.CipherException,
                                oracle.security.crypto.core.InvalidKeyException,
                                oracle.security.crypto.core.AlgorithmIdentifierException
Creates a CMSKeyTransRecipientInfo.
Parameters:
contentEncryptionKey - The encryption key.
keyEncryptionKey - The key encipherment(wrap) key.
iasn - Issuer and Serial Number (IASN) of the recipient's certificate.
keyEncryptionAlgID - The key encipherment(wrap) algorithm.
Throws:
oracle.security.crypto.core.AlgorithmIdentifierException - The encryption algorithm is not supported.
oracle.security.crypto.core.CipherException - An error occurred during encryption.
oracle.security.crypto.core.InvalidKeyException - The encryption keys are not valid.

CMSKeyTransRecipientInfo

public CMSKeyTransRecipientInfo(java.io.InputStream is)
                         throws java.io.IOException
Creates a CMSKeyTransRecipientInfo by reading the BER encoding from the specified input stream.
Parameters:
is - The input stream.
Throws:
java.io.IOException - If the input encoding is incorrect or an I/O error occurs.

CMSKeyTransRecipientInfo

public CMSKeyTransRecipientInfo(oracle.security.crypto.core.SymmetricKey contentEncryptionKey,
                                oracle.security.crypto.core.PublicKey keyEncryptionKey,
                                byte[] spki,
                                oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID)
                         throws oracle.security.crypto.core.CipherException,
                                oracle.security.crypto.core.InvalidKeyException,
                                oracle.security.crypto.core.AlgorithmIdentifierException
Creates a CMSKeyTransRecipientInfo.
Parameters:
contentEncryptionKey - The encryption key.
keyEncryptionKey - The key encipherment(wrap) key.
spki - The recipient's Subject Public Key Identifier(SPKI) value.
keyEncryptionAlgID - The key encipherment(wrap) algorithm.
Throws:
oracle.security.crypto.core.AlgorithmIdentifierException - The encryption algorithm is not supported.
oracle.security.crypto.core.CipherException - An error occurred during encryption.
oracle.security.crypto.core.InvalidKeyException - The encryption keys are not valid.
See Also:
CMSUtils

CMSKeyTransRecipientInfo

public CMSKeyTransRecipientInfo(byte[] hmacKey,
                                oracle.security.crypto.core.PublicKey keyEncryptionKey,
                                oracle.security.crypto.cert.IssuerAndSerialNo iasn,
                                oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID)
                         throws oracle.security.crypto.core.CipherException,
                                oracle.security.crypto.core.InvalidKeyException,
                                oracle.security.crypto.core.AlgorithmIdentifierException
Creates a CMSKeyTransRecipientInfo.
Parameters:
hmacKey - The HMAC key.
keyEncryptionKey - The key encipherment(wrap) key.
keyEncryptionAlgID - The key encipherment(wrap) algorithm.
Throws:
oracle.security.crypto.core.AlgorithmIdentifierException - The encryption algorithm is not supported.
oracle.security.crypto.core.CipherException - An error occurred during encryption.
oracle.security.crypto.core.InvalidKeyException - The encryption keys are not valid.

CMSKeyTransRecipientInfo

public CMSKeyTransRecipientInfo(byte[] hmacKey,
                                oracle.security.crypto.core.PublicKey keyEncryptionKey,
                                byte[] spki,
                                oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID)
                         throws oracle.security.crypto.core.CipherException,
                                oracle.security.crypto.core.InvalidKeyException,
                                oracle.security.crypto.core.AlgorithmIdentifierException
Creates a CMSKeyTransRecipientInfo.
Parameters:
hmacKey - The MAC key.
keyEncryptionKey - The key encipherment(wrap) key.
spki - The recipient's Subject Public Key Identifier(SPKI) value.
keyEncryptionAlgID - The key encipherment(wrap) algorithm.
Throws:
oracle.security.crypto.core.AlgorithmIdentifierException - The encryption algorithm is not supported.
oracle.security.crypto.core.CipherException - An error occurred during encryption.
oracle.security.crypto.core.InvalidKeyException - The encryption keys are not valid.

Method Detail

hashCode

public int hashCode()
Returns a hash code value for this object.
Returns:
The hash code value.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
Returns:
true if this object is the same as the obj argument; false otherwise.

getIASN

public oracle.security.crypto.cert.IssuerAndSerialNo getIASN()
Returns the IssuerAndSerialNo recipient identifier.
Returns:
The IssuerAndSerialNo recipient identifier or null if SPKI is used as the recipient identifier.

getSerialNo

public java.math.BigInteger getSerialNo()
Returns the serial number of the recipient's certificate.
Returns:
The serial number.

getIssuer

public oracle.security.crypto.cert.X500Name getIssuer()
Returns the issuer of the recipient's certificate.
Returns:
The issuer DN.

getKeyEncryptionAlgID

public oracle.security.crypto.core.AlgorithmIdentifier getKeyEncryptionAlgID()
Returns the Key Wrapping or Encipherment Algorithm.
Returns:
The key wrap algorithm identifier.

getEncryptedKey

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

getSPKI

public byte[] getSPKI()
Returns the Subject Public Key Identifier.
Returns:
The SPKI value.

useSPKI64

public boolean useSPKI64()
Indicated if SPKI is being used as the Recipient Identifier.
Returns:
true if SPKI is being used; false if IASN is being used.

getContentEncryptionKey

public oracle.security.crypto.core.SymmetricKey getContentEncryptionKey(oracle.security.crypto.core.PrivateKey keyDecryptionKey)
                                                                 throws oracle.security.crypto.core.AlgorithmIdentifierException,
                                                                        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.
Returns:
The content encryption key.
Throws:
oracle.security.crypto.core.AlgorithmIdentifierException - If the algorithm identifier contained in this recipient-info object is unrecognized.
oracle.security.crypto.core.InvalidKeyException - If the key decryption key could not be used.
oracle.security.crypto.core.CipherException - If an error occured during decryption.

getContentAuthenticationKey

public byte[] getContentAuthenticationKey(oracle.security.crypto.core.PrivateKey keyDecryptionKey)
                                   throws oracle.security.crypto.core.AlgorithmIdentifierException,
                                          oracle.security.crypto.core.InvalidKeyException,
                                          oracle.security.crypto.core.CipherException
Derives the content authentication key, by decryption the encrypted key stored in this object with the given key decryption key.
Parameters:
keyDecryptionKey - The key decryption key.
Returns:
The content authentication key.
Throws:
oracle.security.crypto.core.AlgorithmIdentifierException - If the algorithm identifier contained in this recipient-info object is unrecognized.
oracle.security.crypto.core.InvalidKeyException - If the key decryption key could not be used.
oracle.security.crypto.core.CipherException - If an error occured during decryption.

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.

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
Output this object's encoding to the specified output stream.
Parameters:
os - 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()
A brief textual 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.