Top Description Fields Constructors Methods
org.bouncycastle.cms

public Class CMSEnvelopedDataGenerator

extends CMSEnvelopedGenerator
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, org.bouncycastle.asn1.ASN1EncodableVector, .ASN1Set, .DERSet, org.bouncycastle.asn1.cms.CMSObjectIdentifiers, .ContentInfo, .EncryptedContentInfo, .EnvelopedData, org.bouncycastle.operator.OutputAEADEncryptor, .OutputEncryptor

General class for generating a CMS enveloped-data message. A simple example of usage.
      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());

Field Summary

Inherited from org.bouncycastle.cms.CMSEnvelopedGenerator:
AES128_CBCAES128_WRAPAES192_CBCAES192_WRAPAES256_CBCAES256_WRAPCAMELLIA128_CBCCAMELLIA128_WRAPCAMELLIA192_CBCCAMELLIA192_WRAPCAMELLIA256_CBCCAMELLIA256_WRAPCAST5_CBCDES_EDE3_CBCDES_EDE3_WRAPECDH_SHA1KDFECMQV_SHA1KDFECMQV_SHA224KDFECMQV_SHA256KDFECMQV_SHA384KDFECMQV_SHA512KDFIDEA_CBCoriginatorInfoRC2_CBCrecipientInfoGeneratorsSEED_CBCSEED_WRAPunprotectedAttributeGenerator

Constructor Summary

AccessConstructor and Description
public
CMSEnvelopedDataGenerator()

base constructor

Method Summary

Modifier and TypeMethod and Description
private CMSEnvelopedData
doGenerate(CMSTypedData content, OutputEncryptor contentEncryptor)

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.

Inherited from org.bouncycastle.cms.CMSEnvelopedGenerator:
addRecipientInfoGeneratorsetOriginatorInfosetUnprotectedAttributeGenerator

Constructor Detail

CMSEnvelopedDataGeneratorback to summary
public CMSEnvelopedDataGenerator()

base constructor

Method Detail

doGenerateback to summary
private CMSEnvelopedData doGenerate(CMSTypedData content, OutputEncryptor contentEncryptor) throws CMSException
generateback 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.

Parameters
content:CMSTypedData

the content to be encrypted

contentEncryptor:OutputEncryptor

the symmetric key based encryptor to encrypt the content with.