CMSEncryptedDataGenerator (Bouncy Castle Library 1.52 API Specification)
Date: 2015-03-01

org.bouncycastle.cms

## Class CMSEncryptedDataGenerator

- java.lang.Object
- - org.bouncycastle.cms.CMSEncryptedGenerator
  - - org.bouncycastle.cms.CMSEncryptedDataGenerator

-     public class CMSEncryptedDataGenerator
      extends CMSEncryptedGenerator

  General class for generating a CMS enveloped-data message. A simple example of usage.

             CMSTypedData msg     = new CMSProcessableByteArray("Hello World!".getBytes());

             CMSEncryptedDataGenerator edGen = new CMSEnvelopedDataGenerator();

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

- - ### Field Summary

    - ### Fields inherited from class org.bouncycastle.cms.CMSEncryptedGenerator

      `unprotectedAttributeGenerator`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CMSEncryptedDataGenerator()` base constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `CMSEncryptedData` | `generate(CMSTypedData content, OutputEncryptor contentEncryptor)` generate an encrypted object that contains an CMS Encrypted Data structure.

    - ### Methods inherited from class org.bouncycastle.cms.CMSEncryptedGenerator

      `setUnprotectedAttributeGenerator`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CMSEncryptedDataGenerator

          public CMSEncryptedDataGenerator()

      base constructor

  - ### Method Detail

    - #### generate

          public CMSEncryptedData generate(CMSTypedData content,
                                  OutputEncryptor contentEncryptor)
                                    throws CMSException

      generate an encrypted object that contains an CMS Encrypted Data structure.
      Parameters:
        `content` - the content to be encrypted
        `contentEncryptor` - the symmetric key based encryptor to encrypt the content with.
      Throws:
        `CMSException`