Top Description Fields Constructors Methods
org.bouncycastle.cms

public Class CMSAuthenticatedDataGenerator

extends CMSAuthenticatedGenerator
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, java.util.Collections, .Map, org.bouncycastle.asn1.ASN1EncodableVector, .ASN1Encoding, .ASN1OctetString, .ASN1Set, .BEROctetString, .DEROctetString, .DERSet, org.bouncycastle.asn1.cms.AuthenticatedData, .CMSObjectIdentifiers, .ContentInfo, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.operator.DigestCalculator, .DigestCalculatorProvider, .MacCalculator, .OperatorCreationException, org.bouncycastle.util.io.TeeOutputStream

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()));

Field Summary

Inherited from org.bouncycastle.cms.CMSAuthenticatedGenerator:
authGenunauthGen

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public CMSAuthenticatedData

Returns:

the resulting CMSAuthenticatedData object.
generate
(CMSTypedData
the data to have a MAC attached.
typedData
,
MacCalculator
the calculator of the MAC to be attached.
macCalculator
)

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

public CMSAuthenticatedData

Returns:

the resulting CMSAuthenticatedData object.
generate
(CMSTypedData
the data to have a MAC attached.
typedData
,
MacCalculator
the calculator of the MAC to be attached.
macCalculator
,
final DigestCalculator
calculator for computing digest of the encapsulated data.
digestCalculator
)

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

Inherited from org.bouncycastle.cms.CMSAuthenticatedGenerator:
getBaseParameterssetAuthenticatedAttributeGeneratorsetUnauthenticatedAttributeGenerator

Constructor Detail

CMSAuthenticatedDataGeneratorback to summary
public CMSAuthenticatedDataGenerator()

base constructor

Method Detail

generateback to summary
public CMSAuthenticatedData generate(CMSTypedData typedData, MacCalculator macCalculator) throws CMSException

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

Parameters
typedData:CMSTypedData

the data to have a MAC attached.

macCalculator:MacCalculator

the calculator of the MAC to be attached.

Returns:CMSAuthenticatedData

the resulting CMSAuthenticatedData object.

Exceptions
CMSException:
on failure in encoding data or processing recipients.
generateback to summary
public CMSAuthenticatedData generate(CMSTypedData typedData, MacCalculator macCalculator, final DigestCalculator digestCalculator) throws CMSException

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

Parameters
typedData:CMSTypedData

the data to have a MAC attached.

macCalculator:MacCalculator

the calculator of the MAC to be attached.

digestCalculator:DigestCalculator

calculator for computing digest of the encapsulated data.

Returns:CMSAuthenticatedData

the resulting CMSAuthenticatedData object.

Exceptions
CMSException:
on failure in encoding data or processing recipients.