All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iaik.pkcs.RecipientInfo

java.lang.Object
   |
   +----iaik.pkcs.RecipientInfo

public class RecipientInfo
extends Object
implements ASN1Type
This class implements the PKCS#7 RecipientInfo type. Typical use of this class:


Constructor Index

 o RecipientInfo(ASN1Object)
Creates a RecipientInfo from an ASN1Object.
 o RecipientInfo(IssuerAndSerialNumber, AlgorithmID, byte[])
 o RecipientInfo(X509Certificate, AlgorithmID)
Creates a RecipientInfo object with a certificate and a key encryption algorithm.

Method Index

 o decode(ASN1Object)
Decodes the RecipientInfo-ASN1Object.
 o decryptKey(RSAPrivateKey)
Uses a RSAPrivateKey to decrypt the encrypted content-encryption key.
 o encryptKey(Key)
Finishes the creation of a RecipientInfo object.
 o getEncryptedKey()
 o getIssuerAndSerialNumber()
 o getKeyEncryptionAlgorithm()
 o getVersion()
Returns the version of this RecipientInfo.
 o toASN1Object()
 o toString()
Returns a string that represents the contents of the extensions.

Constructors

 o RecipientInfo
 public RecipientInfo(IssuerAndSerialNumber issuer,
                      AlgorithmID keyEncAlg,
                      byte encryptedKey[])
 o RecipientInfo
 public RecipientInfo(X509Certificate cert,
                      AlgorithmID keyEncAlg)
Creates a RecipientInfo object with a certificate and a key encryption algorithm. The public key from certificate is used to encrypt the symmetric transport key with algorithm keyEncAlg. Finally a call to method @see encryptKey finishes the creation process.

Parameters:
cert - the certificate of the recipient
keyEncAlg - the algorithm used to encrypt symmetric key
 o RecipientInfo
 public RecipientInfo(ASN1Object obj) throws CodingException
Creates a RecipientInfo from an ASN1Object.

Parameters:
obj - the RecipientInfo as ASN1Object

Methods

 o decode
 public void decode(ASN1Object obj) throws CodingException
Decodes the RecipientInfo-ASN1Object.

Parameters:
obj - the RecipientInfo as ASN1Object
 o toASN1Object
 public ASN1Object toASN1Object()
 o decryptKey
 public Key decryptKey(RSAPrivateKey sk)
Uses a RSAPrivateKey to decrypt the encrypted content-encryption key.

Parameters:
sk - the RSAPrivateKey to decrypt the encrypted content-encryption key.
Returns:
the decrypted key as SecretKey in RAW format
 o encryptKey
 public void encryptKey(Key key) throws InvalidKeyException
Finishes the creation of a RecipientInfo object. The public key from certificate is used to encrypt the content-encryption key with algorithm keyEncAlg.

Parameters:
key - the symmetric key transport key for this recipient
 o getVersion
 public int getVersion()
Returns the version of this RecipientInfo.

Returns:
the version
 o getIssuerAndSerialNumber
 public IssuerAndSerialNumber getIssuerAndSerialNumber()
 o getKeyEncryptionAlgorithm
 public AlgorithmID getKeyEncryptionAlgorithm()
 o getEncryptedKey
 public byte[] getEncryptedKey()
 o toString
 public String toString()
Returns a string that represents the contents of the extensions.

Returns:
the string representation
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index