Top Fields Constructors Methods
org.bouncycastle.cms

public Class CMSSignedGenerator

extends Object
Class Inheritance
Known Direct Subclasses
org.bouncycastle.cms.CMSSignedDataGenerator, org.bouncycastle.cms.CMSSignedDataStreamGenerator
Imports
java.util.ArrayList, .HashMap, .HashSet, .Iterator, .List, .Map, .Set, org.bouncycastle.asn1.ASN1Encodable, .ASN1ObjectIdentifier, .DERTaggedObject, org.bouncycastle.asn1.cms.CMSObjectIdentifiers, .OtherRevocationInfoFormat, org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers, org.bouncycastle.asn1.nist.NISTObjectIdentifiers, org.bouncycastle.asn1.oiw.OIWObjectIdentifiers, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, org.bouncycastle.asn1.teletrust.TeleTrusTObjectIdentifiers, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.asn1.x9.X9ObjectIdentifiers, org.bouncycastle.cert.X509AttributeCertificateHolder, .X509CRLHolder, .X509CertificateHolder, org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder, .DigestAlgorithmIdentifierFinder, org.bouncycastle.util.Arrays, .Store

Field Summary

Modifier and TypeField and Description
protected List<E>
protected List<E>
protected List<E>
public static final String
DATA

Default type for the signed data.

public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
protected DigestAlgorithmIdentifierFinder
protected Map<K, V>
private static final Map<K, V>
public static final String
public static final String
private static final String
private static final String
private static final String
private static final String
private static final String
public static final String
public static final String
public static final String
public static final String
private static final Set<E>
protected List<E>

Constructor Summary

AccessConstructor and Description
protected
CMSSignedGenerator()

base constructor

protected

Method Summary

Modifier and TypeMethod and Description
public void
addAttributeCertificate(X509AttributeCertificateHolder
the store containing the certificates to be included.
attrCert
)

Add the attribute certificates in attrStore to the certificate set to be included with the generated SignedData message.

public void
addAttributeCertificates(Store<T>
the store containing the certificates to be included.
attrStore
)

Add the attribute certificates in attrStore to the certificate set to be included with the generated SignedData message.

public void
addCertificate(X509CertificateHolder
the certificate to be included.
certificate
)

Add a certificate to the certificate set to be included with the generated SignedData message.

public void
addCertificates(Store<T>
the store containing the certificates to be included.
certStore
)

Add the certificates in certStore to the certificate set to be included with the generated SignedData message.

public void
addCRL(X509CRLHolder
the CRL to be included.
crl
)

Add a CRL to the CRL set to be included with the generated SignedData message.

public void
addCRLs(Store<T>
the store containing the CRLs to be included.
crlStore
)

Add the CRLs in crlStore to the CRL set to be included with the generated SignedData message.

public void
addOtherRevocationInfo(ASN1ObjectIdentifier
the OID specifying the format of the otherRevocationInfo data.
otherRevocationInfoFormat
,
ASN1Encodable
the otherRevocationInfo ASN.1 structure.
otherRevocationInfo
)

Add a single instance of otherRevocationData to the CRL set to be included with the generated SignedData message.

public void
addOtherRevocationInfo(ASN1ObjectIdentifier
the OID specifying the format of the otherRevocationInfo data.
otherRevocationInfoFormat
,
Store<T>
a Store of otherRevocationInfo data to add.
otherRevocationInfos
)

Add a Store of otherRevocationData to the CRL set to be included with the generated SignedData message.

public void
addSignerInfoGenerator(SignerInfoGenerator
the generator representing the particular signer.
infoGen
)

Add a generator for a particular signer to this CMS SignedData generator.

public void
addSigners(SignerInformationStore
store of signers
signerStore
)

Add a store of pre-calculated signers to the generator.

protected Map<K, V>
getBaseParameters(ASN1ObjectIdentifier contentType, AlgorithmIdentifier digAlgId, byte[] hash)

public Map<K, V>

Returns:

a map of oids (as String objects) and byte[] representing digests.
getGeneratedDigests
()

Return a map of oids and byte arrays representing the digests calculated on the content during the last generate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_signersback to summary
protected List<E> _signers
certsback to summary
protected List<E> certs
crlsback to summary
protected List<E> crls
DATAback to summary
public static final String DATA

Default type for the signed data.

DIGEST_GOST3411back to summary
public static final String DIGEST_GOST3411
DIGEST_MD5back to summary
public static final String DIGEST_MD5
DIGEST_RIPEMD128back to summary
public static final String DIGEST_RIPEMD128
DIGEST_RIPEMD160back to summary
public static final String DIGEST_RIPEMD160
DIGEST_RIPEMD256back to summary
public static final String DIGEST_RIPEMD256
DIGEST_SHA1back to summary
public static final String DIGEST_SHA1
DIGEST_SHA224back to summary
public static final String DIGEST_SHA224
DIGEST_SHA256back to summary
public static final String DIGEST_SHA256
DIGEST_SHA384back to summary
public static final String DIGEST_SHA384
DIGEST_SHA512back to summary
public static final String DIGEST_SHA512
digestAlgIdFinderback to summary
protected DigestAlgorithmIdentifierFinder digestAlgIdFinder
digestsback to summary
protected Map<K, V> digests
EC_ALGORITHMSback to summary
private static final Map<K, V> EC_ALGORITHMS
ENCRYPTION_DSAback to summary
public static final String ENCRYPTION_DSA
ENCRYPTION_ECDSAback to summary
public static final String ENCRYPTION_ECDSA
ENCRYPTION_ECDSA_WITH_SHA1back to summary
private static final String ENCRYPTION_ECDSA_WITH_SHA1
ENCRYPTION_ECDSA_WITH_SHA224back to summary
private static final String ENCRYPTION_ECDSA_WITH_SHA224
ENCRYPTION_ECDSA_WITH_SHA256back to summary
private static final String ENCRYPTION_ECDSA_WITH_SHA256
ENCRYPTION_ECDSA_WITH_SHA384back to summary
private static final String ENCRYPTION_ECDSA_WITH_SHA384
ENCRYPTION_ECDSA_WITH_SHA512back to summary
private static final String ENCRYPTION_ECDSA_WITH_SHA512
ENCRYPTION_ECGOST3410back to summary
public static final String ENCRYPTION_ECGOST3410
ENCRYPTION_GOST3410back to summary
public static final String ENCRYPTION_GOST3410
ENCRYPTION_RSAback to summary
public static final String ENCRYPTION_RSA
ENCRYPTION_RSA_PSSback to summary
public static final String ENCRYPTION_RSA_PSS
NO_PARAMSback to summary
private static final Set<E> NO_PARAMS
signerGensback to summary
protected List<E> signerGens

Constructor Detail

CMSSignedGeneratorback to summary
protected CMSSignedGenerator()

base constructor

CMSSignedGeneratorback to summary
protected CMSSignedGenerator(DigestAlgorithmIdentifierFinder digestAlgIdFinder)

Method Detail

addAttributeCertificateback to summary
public void addAttributeCertificate(X509AttributeCertificateHolder attrCert) throws CMSException

Add the attribute certificates in attrStore to the certificate set to be included with the generated SignedData message.

Parameters
attrCert:X509AttributeCertificateHolder

the store containing the certificates to be included.

Exceptions
CMSException:
if the attribute certificate cannot be encoded for adding.
addAttributeCertificatesback to summary
public void addAttributeCertificates(Store<T> attrStore) throws CMSException

Add the attribute certificates in attrStore to the certificate set to be included with the generated SignedData message.

Parameters
attrStore:Store<T>

the store containing the certificates to be included.

Exceptions
CMSException:
if the attribute certificate cannot be encoded for adding.
addCertificateback to summary
public void addCertificate(X509CertificateHolder certificate) throws CMSException

Add a certificate to the certificate set to be included with the generated SignedData message.

Parameters
certificate:X509CertificateHolder

the certificate to be included.

Exceptions
CMSException:
if the certificate cannot be encoded for adding.
addCertificatesback to summary
public void addCertificates(Store<T> certStore) throws CMSException

Add the certificates in certStore to the certificate set to be included with the generated SignedData message.

Parameters
certStore:Store<T>

the store containing the certificates to be included.

Exceptions
CMSException:
if the certificates cannot be encoded for adding.
addCRLback to summary
public void addCRL(X509CRLHolder crl)

Add a CRL to the CRL set to be included with the generated SignedData message.

Parameters
crl:X509CRLHolder

the CRL to be included.

addCRLsback to summary
public void addCRLs(Store<T> crlStore) throws CMSException

Add the CRLs in crlStore to the CRL set to be included with the generated SignedData message.

Parameters
crlStore:Store<T>

the store containing the CRLs to be included.

Exceptions
CMSException:
if the CRLs cannot be encoded for adding.
addOtherRevocationInfoback to summary
public void addOtherRevocationInfo(ASN1ObjectIdentifier otherRevocationInfoFormat, ASN1Encodable otherRevocationInfo)

Add a single instance of otherRevocationData to the CRL set to be included with the generated SignedData message.

Parameters
otherRevocationInfoFormat:ASN1ObjectIdentifier

the OID specifying the format of the otherRevocationInfo data.

otherRevocationInfo:ASN1Encodable

the otherRevocationInfo ASN.1 structure.

addOtherRevocationInfoback to summary
public void addOtherRevocationInfo(ASN1ObjectIdentifier otherRevocationInfoFormat, Store<T> otherRevocationInfos)

Add a Store of otherRevocationData to the CRL set to be included with the generated SignedData message.

Parameters
otherRevocationInfoFormat:ASN1ObjectIdentifier

the OID specifying the format of the otherRevocationInfo data.

otherRevocationInfos:Store<T>

a Store of otherRevocationInfo data to add.

addSignerInfoGeneratorback to summary
public void addSignerInfoGenerator(SignerInfoGenerator infoGen)

Add a generator for a particular signer to this CMS SignedData generator.

Parameters
infoGen:SignerInfoGenerator

the generator representing the particular signer.

addSignersback to summary
public void addSigners(SignerInformationStore signerStore)

Add a store of pre-calculated signers to the generator.

Parameters
signerStore:SignerInformationStore

store of signers

getBaseParametersback to summary
protected Map<K, V> getBaseParameters(ASN1ObjectIdentifier contentType, AlgorithmIdentifier digAlgId, byte[] hash)
getGeneratedDigestsback to summary
public Map<K, V> getGeneratedDigests()

Return a map of oids and byte arrays representing the digests calculated on the content during the last generate.

Returns:Map<K, V>

a map of oids (as String objects) and byte[] representing digests.