org.bouncycastle.cms

Class CMSSignedGenerator

public class CMSSignedGenerator extends Object

Field Summary
static StringDATA
Default type for the signed data.
static StringDIGEST_GOST3411
static StringDIGEST_MD5
static StringDIGEST_RIPEMD128
static StringDIGEST_RIPEMD160
static StringDIGEST_RIPEMD256
static StringDIGEST_SHA1
static StringDIGEST_SHA224
static StringDIGEST_SHA256
static StringDIGEST_SHA384
static StringDIGEST_SHA512
static StringENCRYPTION_DSA
static StringENCRYPTION_ECDSA
static StringENCRYPTION_ECGOST3410
static StringENCRYPTION_GOST3410
static StringENCRYPTION_RSA
static StringENCRYPTION_RSA_PSS
protected List_certs
protected List_crls
protected Map_digests
protected List_signers
Constructor Summary
protected CMSSignedGenerator()
Method Summary
voidaddAttributeCertificates(X509Store store)
Add the attribute certificates contained in the passed in store to the generator.
voidaddCertificatesAndCRLs(CertStore certStore)
add the certificates and CRLs contained in the given CertStore to the pool that will be included in the encoded signature block.
voidaddSigners(SignerInformationStore signerStore)
Add a store of precalculated signers to the generator.
protected ASN1SetgetAttributeSet(AttributeTable attr)
protected MapgetBaseParameters(DERObjectIdentifier contentType, AlgorithmIdentifier digAlgId, byte[] hash)
protected AlgorithmIdentifiergetEncAlgorithmIdentifier(String encOid)
protected StringgetEncOID(PrivateKey key, String digestOID)
MapgetGeneratedDigests()
Return a map of oids and byte arrays representing the digests calculated on the content during the last generate.

Field Detail

DATA

public static final String DATA
Default type for the signed data.

DIGEST_GOST3411

public static final String DIGEST_GOST3411

DIGEST_MD5

public static final String DIGEST_MD5

DIGEST_RIPEMD128

public static final String DIGEST_RIPEMD128

DIGEST_RIPEMD160

public static final String DIGEST_RIPEMD160

DIGEST_RIPEMD256

public static final String DIGEST_RIPEMD256

DIGEST_SHA1

public static final String DIGEST_SHA1

DIGEST_SHA224

public static final String DIGEST_SHA224

DIGEST_SHA256

public static final String DIGEST_SHA256

DIGEST_SHA384

public static final String DIGEST_SHA384

DIGEST_SHA512

public static final String DIGEST_SHA512

ENCRYPTION_DSA

public static final String ENCRYPTION_DSA

ENCRYPTION_ECDSA

public static final String ENCRYPTION_ECDSA

ENCRYPTION_ECGOST3410

public static final String ENCRYPTION_ECGOST3410

ENCRYPTION_GOST3410

public static final String ENCRYPTION_GOST3410

ENCRYPTION_RSA

public static final String ENCRYPTION_RSA

ENCRYPTION_RSA_PSS

public static final String ENCRYPTION_RSA_PSS

_certs

protected List _certs

_crls

protected List _crls

_digests

protected Map _digests

_signers

protected List _signers

Constructor Detail

CMSSignedGenerator

protected CMSSignedGenerator()

Method Detail

addAttributeCertificates

public void addAttributeCertificates(X509Store store)
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.

addCertificatesAndCRLs

public void addCertificatesAndCRLs(CertStore certStore)
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: java.security.cert.CertStoreException if an issue occurs processing the CertStore CMSException if an issue occurse transforming data from the CertStore into the message

addSigners

public void addSigners(SignerInformationStore signerStore)
Add a store of precalculated signers to the generator.

Parameters: signerStore store of signers

getAttributeSet

protected ASN1Set getAttributeSet(AttributeTable attr)

getBaseParameters

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

getEncAlgorithmIdentifier

protected AlgorithmIdentifier getEncAlgorithmIdentifier(String encOid)

getEncOID

protected String getEncOID(PrivateKey key, String digestOID)

getGeneratedDigests

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.