org.bouncycastle.cms
Class CMSEnvelopedDataGenerator
java.lang.Object
org.bouncycastle.cms.CMSEnvelopedDataGenerator
public class CMSEnvelopedDataGenerator
extends java.lang.Object
General class for generating a CMS enveloped-data message.
A simple example of usage.
CMSEnvelopedDataGenerator fact = new CMSEnvelopedDataGenerator();
fact.addKeyTransRecipient(cert);
CMSEnvelopedData data = fact.generate(content, algorithm, "BC");
AES128_CBC
public static final String AES128_CBC
AES192_CBC
public static final String AES192_CBC
AES256_CBC
public static final String AES256_CBC
CAST5_CBC
public static final String CAST5_CBC
DES_EDE3_CBC
public static final String DES_EDE3_CBC
IDEA_CBC
public static final String IDEA_CBC
RC2_CBC
public static final String RC2_CBC
CMSEnvelopedDataGenerator
public CMSEnvelopedDataGenerator()
base constructor
addKEKRecipient
public void addKEKRecipient(SecretKey key,
byte[] keyIdentifier)
add a KEK recipient.
addKeyTransRecipient
public void addKeyTransRecipient(PublicKey key,
byte[] subKeyId)
throws IllegalArgumentException
add a recipient
key
- the public key used by the recipientsubKeyId
- the identifier for the recipient's public key
addKeyTransRecipient
public void addKeyTransRecipient(X509Certificate cert)
throws IllegalArgumentException
add a recipient.
generate
public CMSEnvelopedData generate(CMSProcessable content,
String encryptionOID,
String provider)
throws NoSuchAlgorithmException,
NoSuchProviderException,
CMSException
generate an enveloped object that contains an CMS Enveloped Data
object using the given provider.
generate
public CMSEnvelopedData generate(CMSProcessable content,
String encryptionOID,
int keySize,
String provider)
throws NoSuchAlgorithmException,
NoSuchProviderException,
CMSException
generate an enveloped object that contains an CMS Enveloped Data
object using the given provider.