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:
-
RecipientInfo(ASN1Object)
- Creates a RecipientInfo from an ASN1Object.
-
RecipientInfo(IssuerAndSerialNumber, AlgorithmID, byte[])
-
-
RecipientInfo(X509Certificate, AlgorithmID)
- Creates a RecipientInfo object with a certificate and a key encryption
algorithm.
-
decode(ASN1Object)
- Decodes the RecipientInfo-ASN1Object.
-
decryptKey(RSAPrivateKey)
- Uses a RSAPrivateKey to decrypt the encrypted content-encryption key.
-
encryptKey(Key)
- Finishes the creation of a RecipientInfo object.
-
getEncryptedKey()
-
-
getIssuerAndSerialNumber()
-
-
getKeyEncryptionAlgorithm()
-
-
getVersion()
- Returns the version of this RecipientInfo.
-
toASN1Object()
-
-
toString()
- Returns a string that represents the contents of the extensions.
RecipientInfo
public RecipientInfo(IssuerAndSerialNumber issuer,
AlgorithmID keyEncAlg,
byte encryptedKey[])
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
RecipientInfo
public RecipientInfo(ASN1Object obj) throws CodingException
- Creates a RecipientInfo from an ASN1Object.
- Parameters:
- obj - the RecipientInfo as ASN1Object
decode
public void decode(ASN1Object obj) throws CodingException
- Decodes the RecipientInfo-ASN1Object.
- Parameters:
- obj - the RecipientInfo as ASN1Object
toASN1Object
public ASN1Object toASN1Object()
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
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
getVersion
public int getVersion()
- Returns the version of this RecipientInfo.
- Returns:
- the version
getIssuerAndSerialNumber
public IssuerAndSerialNumber getIssuerAndSerialNumber()
getKeyEncryptionAlgorithm
public AlgorithmID getKeyEncryptionAlgorithm()
getEncryptedKey
public byte[] getEncryptedKey()
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