public class

CMSSignedGenerator

extends Object
java.lang.Object
   ↳ org.bouncycastle.cms.CMSSignedGenerator
Known Direct Subclasses

Summary

Fields
public static final String DATA Default type for the signed data.
public static final String DIGEST_GOST3411
public static final String DIGEST_MD5
public static final String DIGEST_RIPEMD128
public static final String DIGEST_RIPEMD160
public static final String DIGEST_RIPEMD256
public static final String DIGEST_SHA1
public static final String DIGEST_SHA224
public static final String DIGEST_SHA256
public static final String DIGEST_SHA384
public static final String DIGEST_SHA512
public static final String ENCRYPTION_DSA
public static final String ENCRYPTION_ECDSA
public static final String ENCRYPTION_ECGOST3410
public static final String ENCRYPTION_GOST3410
public static final String ENCRYPTION_RSA
public static final String ENCRYPTION_RSA_PSS
protected List _signers
protected List certs
protected List crls
protected Map digests
protected final SecureRandom rand
protected List signerGens
Protected Constructors
CMSSignedGenerator()
base constructor
CMSSignedGenerator(SecureRandom rand)
constructor allowing specific source of randomness
Public Methods
void addAttributeCertificates(Store attrStore)
void addAttributeCertificates(X509Store store)
This method is deprecated. use basic Store method
void addCRLs(Store crlStore)
void addCertificates(Store certStore)
void addCertificatesAndCRLs(CertStore certStore)
This method is deprecated. use addCertificates and addCRLs
void addSignerInfoGenerator(SignerInfoGenerator infoGen)
void addSigners(SignerInformationStore signerStore)
Add a store of precalculated signers to the generator.
Map getGeneratedDigests()
Return a map of oids and byte arrays representing the digests calculated on the content during the last generate.
Protected Methods
ASN1Set getAttributeSet(AttributeTable attr)
Map getBaseParameters(DERObjectIdentifier contentType, AlgorithmIdentifier digAlgId, byte[] hash)
AlgorithmIdentifier getEncAlgorithmIdentifier(String encOid, Signature sig)
String getEncOID(PrivateKey key, String digestOID)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final String DATA

Default type for the signed data.

public static final String DIGEST_GOST3411

public static final String DIGEST_MD5

public static final String DIGEST_RIPEMD128

public static final String DIGEST_RIPEMD160

public static final String DIGEST_RIPEMD256

public static final String DIGEST_SHA1

public static final String DIGEST_SHA224

public static final String DIGEST_SHA256

public static final String DIGEST_SHA384

public static final String DIGEST_SHA512

public static final String ENCRYPTION_DSA

public static final String ENCRYPTION_ECDSA

public static final String ENCRYPTION_ECGOST3410

public static final String ENCRYPTION_GOST3410

public static final String ENCRYPTION_RSA

public static final String ENCRYPTION_RSA_PSS

protected List _signers

protected List certs

protected List crls

protected Map digests

protected final SecureRandom rand

protected List signerGens

Protected Constructors

protected CMSSignedGenerator ()

base constructor

protected CMSSignedGenerator (SecureRandom rand)

constructor allowing specific source of randomness

Parameters
rand instance of SecureRandom to use

Public Methods

public void addAttributeCertificates (Store attrStore)

Throws
CMSException

public void addAttributeCertificates (X509Store store)

This method is deprecated.
use basic Store method

Add the attribute certificates contained in the passed in store to the generator.

Parameters
store a store of Version 2 attribute certificates
Throws
CMSException if an error occurse processing the store.

public void addCRLs (Store crlStore)

Throws
CMSException

public void addCertificates (Store certStore)

Throws
CMSException

public void addCertificatesAndCRLs (CertStore certStore)

This method is deprecated.
use addCertificates and addCRLs

add the certificates and CRLs contained in the given CertStore to the pool that will be included in the encoded signature block.

Note: this assumes the CertStore will support null in the get methods.

Parameters
certStore CertStore containing the public key certificates and CRLs
Throws
CertStoreException if an issue occurs processing the CertStore
CMSException if an issue occurse transforming data from the CertStore into the message

public void addSignerInfoGenerator (SignerInfoGenerator infoGen)

public void addSigners (SignerInformationStore signerStore)

Add a store of precalculated signers to the generator.

Parameters
signerStore store of signers

public Map getGeneratedDigests ()

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

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

Protected Methods

protected ASN1Set getAttributeSet (AttributeTable attr)

protected Map getBaseParameters (DERObjectIdentifier contentType, AlgorithmIdentifier digAlgId, byte[] hash)

protected AlgorithmIdentifier getEncAlgorithmIdentifier (String encOid, Signature sig)

Throws
IOException

protected String getEncOID (PrivateKey key, String digestOID)