Top Description Fields Constructors Methods
org.bouncycastle.cms

public Class CMSEncryptedDataGenerator

extends CMSEncryptedGenerator
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, java.util.Collections, org.bouncycastle.asn1.ASN1OctetString, .ASN1Set, .BEROctetString, .BERSet, org.bouncycastle.asn1.cms.AttributeTable, .CMSObjectIdentifiers, .ContentInfo, .EncryptedContentInfo, .EncryptedData, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.operator.OutputEncryptor

General class for generating a CMS encrypted-data message. A simple example of usage.
      CMSTypedData msg     = new CMSProcessableByteArray("Hello World!".getBytes());

      CMSEncryptedDataGenerator edGen = new CMSEncryptedDataGenerator();

      CMSEncryptedData ed = edGen.generate(
                                      msg,
                                      new JceCMSContentEncryptorBuilder(CMSAlgorithm.DES_EDE3_CBC)
                                             .setProvider("BC").build());

Field Summary

Inherited from org.bouncycastle.cms.CMSEncryptedGenerator:
unprotectedAttributeGenerator

Constructor Summary

AccessConstructor and Description
public
CMSEncryptedDataGenerator()

base constructor

Method Summary

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

public CMSEncryptedData
generate(CMSTypedData
the content to be encrypted
content
,
OutputEncryptor
the symmetric key based encryptor to encrypt the content with.
contentEncryptor
)

generate an encrypted object that contains an CMS Encrypted Data structure.

Inherited from org.bouncycastle.cms.CMSEncryptedGenerator:
setUnprotectedAttributeGenerator

Constructor Detail

CMSEncryptedDataGeneratorback to summary
public CMSEncryptedDataGenerator()

base constructor

Method Detail

doGenerateback to summary
private CMSEncryptedData doGenerate(CMSTypedData content, OutputEncryptor contentEncryptor) throws CMSException
generateback to summary
public CMSEncryptedData generate(CMSTypedData content, OutputEncryptor contentEncryptor) throws CMSException

generate an encrypted object that contains an CMS Encrypted Data structure.

Parameters
content:CMSTypedData

the content to be encrypted

contentEncryptor:OutputEncryptor

the symmetric key based encryptor to encrypt the content with.