public class

CMSAuthenticatedDataGenerator

extends CMSAuthenticatedGenerator
java.lang.Object
   ↳ org.bouncycastle.cms.CMSEnvelopedGenerator
     ↳ org.bouncycastle.cms.CMSAuthenticatedGenerator
       ↳ org.bouncycastle.cms.CMSAuthenticatedDataGenerator

Class Overview

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

      CMSAuthenticatedDataGenerator  fact = new CMSAuthenticatedDataGenerator();

      adGen.addRecipientInfoGenerator(new JceKeyTransRecipientInfoGenerator(recipientCert).setProvider("BC"));

      CMSAuthenticatedData         data = fact.generate(new CMSProcessableByteArray(data),
                              new JceCMSMacCalculatorBuilder(CMSAlgorithm.DES_EDE3_CBC).setProvider(BC).build()));
 

Summary

[Expand]
Inherited Constants
From class org.bouncycastle.cms.CMSEnvelopedGenerator
[Expand]
Inherited Fields
From class org.bouncycastle.cms.CMSAuthenticatedGenerator
From class org.bouncycastle.cms.CMSEnvelopedGenerator
Public Constructors
CMSAuthenticatedDataGenerator()
base constructor
CMSAuthenticatedDataGenerator(SecureRandom rand)
This constructor is deprecated. no longer required, use simple constructor.
Public Methods
CMSAuthenticatedData generate(CMSProcessable content, String macOID, String provider)
This method is deprecated. use addRecipientInfoGenerator method.
CMSAuthenticatedData generate(CMSTypedData typedData, MacCalculator macCalculator, DigestCalculator digestCalculator)
Generate an authenticated data object from the passed in typedData and MacCalculator.
CMSAuthenticatedData generate(CMSTypedData typedData, MacCalculator macCalculator)
Generate an authenticated data object from the passed in typedData and MacCalculator.
CMSAuthenticatedData generate(CMSProcessable content, String encryptionOID, Provider provider)
This method is deprecated. use addRecipientInfoGenerator method..
[Expand]
Inherited Methods
From class org.bouncycastle.cms.CMSAuthenticatedGenerator
From class org.bouncycastle.cms.CMSEnvelopedGenerator
From class java.lang.Object

Public Constructors

public CMSAuthenticatedDataGenerator ()

base constructor

public CMSAuthenticatedDataGenerator (SecureRandom rand)

This constructor is deprecated.
no longer required, use simple constructor.

constructor allowing specific source of randomness

Parameters
rand instance of SecureRandom to use

Public Methods

public CMSAuthenticatedData generate (CMSProcessable content, String macOID, String provider)

This method is deprecated.
use addRecipientInfoGenerator method.

generate an authenticated object that contains an CMS Authenticated Data object using the given provider.

public CMSAuthenticatedData generate (CMSTypedData typedData, MacCalculator macCalculator, DigestCalculator digestCalculator)

Generate an authenticated data object from the passed in typedData and MacCalculator.

Parameters
typedData the data to have a MAC attached.
macCalculator the calculator of the MAC to be attached.
digestCalculator calculator for computing digest of the encapsulated data.
Returns
  • the resulting CMSAuthenticatedData object.
Throws
CMSException on failure in encoding data or processing recipients.

public CMSAuthenticatedData generate (CMSTypedData typedData, MacCalculator macCalculator)

Generate an authenticated data object from the passed in typedData and MacCalculator.

Parameters
typedData the data to have a MAC attached.
macCalculator the calculator of the MAC to be attached.
Returns
  • the resulting CMSAuthenticatedData object.
Throws
CMSException on failure in encoding data or processing recipients.

public CMSAuthenticatedData generate (CMSProcessable content, String encryptionOID, Provider provider)

This method is deprecated.
use addRecipientInfoGenerator method..

generate an authenticated object that contains an CMS Authenticated Data object using the given provider