CMSTypedData msg = new CMSProcessableByteArray("Hello World!".getBytes());
CMSEnvelopedDataGenerator edGen = new CMSEnvelopedDataGenerator();
edGen.addRecipientInfoGenerator(new JceKeyTransRecipientInfoGenerator(recipientCert).setProvider("BC"));
CMSEnvelopedData ed = edGen.generate(
msg,
new JceCMSContentEncryptorBuilder(CMSAlgorithm.DES_EDE3_CBC)
.setProvider("BC").build());
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private CMSEnvelopedData | |
| public CMSEnvelopedData | generate(CMSTypedData
the content to be encrypted content, OutputEncryptor the symmetric key based encryptor to encrypt the content with. contentEncryptor)generate an enveloped object that contains an CMS Enveloped Data object using the given provider. |
| CMSEnvelopedDataGenerator | back to summary |
|---|---|
| public CMSEnvelopedDataGenerator() base constructor | |
| doGenerate | back to summary |
|---|---|
| private CMSEnvelopedData doGenerate(CMSTypedData content, OutputEncryptor contentEncryptor) throws CMSException | |
| generate | back to summary |
|---|---|
| public CMSEnvelopedData generate(CMSTypedData content, OutputEncryptor contentEncryptor) throws CMSException generate an enveloped object that contains an CMS Enveloped Data object using the given provider.
| |