org.bouncycastle.cms

Class CMSSignedGenerator

Known Direct Subclasses:
CMSSignedDataGenerator, CMSSignedDataStreamGenerator

public class CMSSignedGenerator
extends java.lang.Object

Field Summary

static String
DATA
Default type for the signed data.
static String
DIGEST_GOST3411
static String
DIGEST_MD5
static String
DIGEST_RIPEMD128
static String
DIGEST_RIPEMD160
static String
DIGEST_RIPEMD256
static String
DIGEST_SHA1
static String
DIGEST_SHA224
static String
DIGEST_SHA256
static String
DIGEST_SHA384
static String
DIGEST_SHA512
static String
ENCRYPTION_DSA
static String
ENCRYPTION_ECDSA
static String
ENCRYPTION_ECGOST3410
static String
ENCRYPTION_GOST3410
static String
ENCRYPTION_RSA
static String
ENCRYPTION_RSA_PSS
protected List
_certs
protected List
_crls
protected Map
_digests
protected List
_signers

Constructor Summary

CMSSignedGenerator()

Method Summary

void
addAttributeCertificates(X509Store store)
Add the attribute certificates contained in the passed in store to the generator.
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.
void
addSigners(SignerInformationStore signerStore)
Add a store of precalculated signers to the generator.
protected ASN1Set
getAttributeSet(AttributeTable attr)
protected Map
getBaseParameters(DERObjectIdentifier contentType, AlgorithmIdentifier digAlgId, byte[] hash)
protected AlgorithmIdentifier
getEncAlgorithmIdentifier(String encOid)
protected String
getEncOID(PrivateKey key, String digestOID)
Map
getGeneratedDigests()
Return a map of oids and byte arrays representing the digests calculated on the content during the last generate.

Field Details

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 Details

CMSSignedGenerator

protected CMSSignedGenerator()

Method Details

addAttributeCertificates

public void addAttributeCertificates(X509Store store)
            throws CMSException
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)
            throws CertStoreException,
                   CMSException
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:
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.