public class CMSSignedGenerator extends Object
Modifier and Type | Field and Description |
---|---|
protected List |
_signers |
protected List |
certs |
protected List |
crls |
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 |
protected Map |
digests |
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 SecureRandom |
rand |
protected List |
signerGens |
Modifier | Constructor and Description |
---|---|
protected |
CMSSignedGenerator()
base constructor
|
protected |
CMSSignedGenerator(SecureRandom rand)
constructor allowing specific source of randomness
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeCertificates(Store attrStore) |
void |
addAttributeCertificates(X509Store store)
Deprecated.
use basic Store method
|
void |
addCertificates(Store certStore) |
void |
addCertificatesAndCRLs(CertStore certStore)
Deprecated.
use addCertificates and addCRLs
|
void |
addCRLs(Store crlStore) |
void |
addSignerInfoGenerator(SignerInfoGenerator infoGen) |
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,
Signature sig) |
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.
|
public static final String DATA
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 DIGEST_MD5
public static final String DIGEST_GOST3411
public static final String DIGEST_RIPEMD128
public static final String DIGEST_RIPEMD160
public static final String DIGEST_RIPEMD256
public static final String ENCRYPTION_RSA
public static final String ENCRYPTION_DSA
public static final String ENCRYPTION_ECDSA
public static final String ENCRYPTION_RSA_PSS
public static final String ENCRYPTION_GOST3410
public static final String ENCRYPTION_ECGOST3410
protected List certs
protected List crls
protected List _signers
protected List signerGens
protected Map digests
protected final SecureRandom rand
protected CMSSignedGenerator()
protected CMSSignedGenerator(SecureRandom rand)
rand
- instance of SecureRandom to useprotected String getEncOID(PrivateKey key, String digestOID)
protected AlgorithmIdentifier getEncAlgorithmIdentifier(String encOid, Signature sig) throws IOException
IOException
protected Map getBaseParameters(DERObjectIdentifier contentType, AlgorithmIdentifier digAlgId, byte[] hash)
protected ASN1Set getAttributeSet(AttributeTable attr)
public void addCertificatesAndCRLs(CertStore certStore) throws CertStoreException, CMSException
Note: this assumes the CertStore will support null in the get methods.
certStore
- CertStore containing the public key certificates and CRLsCertStoreException
- if an issue occurs processing the CertStoreCMSException
- if an issue occurse transforming data from the CertStore into the messagepublic void addCertificates(Store certStore) throws CMSException
CMSException
public void addCRLs(Store crlStore) throws CMSException
CMSException
public void addAttributeCertificates(Store attrStore) throws CMSException
CMSException
public void addAttributeCertificates(X509Store store) throws CMSException
store
- a store of Version 2 attribute certificatesCMSException
- if an error occurse processing the store.public void addSigners(SignerInformationStore signerStore)
signerStore
- store of signerspublic void addSignerInfoGenerator(SignerInfoGenerator infoGen)
public Map getGeneratedDigests()
Copyright © 2015. All rights reserved.