public class CMSSignedGenerator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List |
_signers |
protected java.util.List |
certs |
protected java.util.List |
crls |
static java.lang.String |
DATA
Default type for the signed data.
|
static java.lang.String |
DIGEST_GOST3411 |
static java.lang.String |
DIGEST_MD5 |
static java.lang.String |
DIGEST_RIPEMD128 |
static java.lang.String |
DIGEST_RIPEMD160 |
static java.lang.String |
DIGEST_RIPEMD256 |
static java.lang.String |
DIGEST_SHA1 |
static java.lang.String |
DIGEST_SHA224 |
static java.lang.String |
DIGEST_SHA256 |
static java.lang.String |
DIGEST_SHA384 |
static java.lang.String |
DIGEST_SHA512 |
protected java.util.Map |
digests |
static java.lang.String |
ENCRYPTION_DSA |
static java.lang.String |
ENCRYPTION_ECDSA |
static java.lang.String |
ENCRYPTION_ECGOST3410 |
static java.lang.String |
ENCRYPTION_GOST3410 |
static java.lang.String |
ENCRYPTION_RSA |
static java.lang.String |
ENCRYPTION_RSA_PSS |
protected java.security.SecureRandom |
rand |
protected java.util.List |
signerGens |
Modifier | Constructor and Description |
---|---|
protected |
CMSSignedGenerator()
base constructor
|
protected |
CMSSignedGenerator(java.security.SecureRandom rand)
constructor allowing specific source of randomness
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeCertificate(X509AttributeCertificateHolder attrCert)
Add the attribute certificates in attrStore to the certificate set to be included with the generated SignedData message.
|
void |
addAttributeCertificates(org.bouncycastle.util.Store attrStore)
Add the attribute certificates in attrStore to the certificate set to be included with the generated SignedData message.
|
void |
addAttributeCertificates(org.bouncycastle.x509.X509Store store)
Deprecated.
use basic Store method
|
void |
addCertificate(X509CertificateHolder certificate)
Add a certificate to the certificate set to be included with the generated SignedData message.
|
void |
addCertificates(org.bouncycastle.util.Store certStore)
Add the certificates in certStore to the certificate set to be included with the generated SignedData message.
|
void |
addCertificatesAndCRLs(java.security.cert.CertStore certStore)
Deprecated.
use addCertificates and addCRLs
|
void |
addCRL(X509CRLHolder crl)
Add a CRL to the CRL set to be included with the generated SignedData message.
|
void |
addCRLs(org.bouncycastle.util.Store crlStore)
Add the CRLs in crlStore to the CRL set to be included with the generated SignedData message.
|
void |
addOtherRevocationInfo(org.bouncycastle.asn1.ASN1ObjectIdentifier otherRevocationInfoFormat,
org.bouncycastle.asn1.ASN1Encodable otherRevocationInfo)
Add a single instance of otherRevocationData to the CRL set to be included with the generated SignedData message.
|
void |
addOtherRevocationInfo(org.bouncycastle.asn1.ASN1ObjectIdentifier otherRevocationInfoFormat,
org.bouncycastle.util.Store otherRevocationInfos)
Add a Store of otherRevocationData to the CRL set to be included with the generated SignedData message.
|
void |
addSignerInfoGenerator(SignerInfoGenerator infoGen) |
void |
addSigners(SignerInformationStore signerStore)
Add a store of precalculated signers to the generator.
|
protected org.bouncycastle.asn1.ASN1Set |
getAttributeSet(org.bouncycastle.asn1.cms.AttributeTable attr) |
protected java.util.Map |
getBaseParameters(org.bouncycastle.asn1.ASN1ObjectIdentifier contentType,
org.bouncycastle.asn1.x509.AlgorithmIdentifier digAlgId,
byte[] hash) |
protected java.lang.String |
getEncOID(java.security.PrivateKey key,
java.lang.String digestOID) |
java.util.Map |
getGeneratedDigests()
Return a map of oids and byte arrays representing the digests calculated on the content during
the last generate.
|
public static final java.lang.String DATA
public static final java.lang.String DIGEST_SHA1
public static final java.lang.String DIGEST_SHA224
public static final java.lang.String DIGEST_SHA256
public static final java.lang.String DIGEST_SHA384
public static final java.lang.String DIGEST_SHA512
public static final java.lang.String DIGEST_MD5
public static final java.lang.String DIGEST_GOST3411
public static final java.lang.String DIGEST_RIPEMD128
public static final java.lang.String DIGEST_RIPEMD160
public static final java.lang.String DIGEST_RIPEMD256
public static final java.lang.String ENCRYPTION_RSA
public static final java.lang.String ENCRYPTION_DSA
public static final java.lang.String ENCRYPTION_ECDSA
public static final java.lang.String ENCRYPTION_RSA_PSS
public static final java.lang.String ENCRYPTION_GOST3410
public static final java.lang.String ENCRYPTION_ECGOST3410
protected java.util.List certs
protected java.util.List crls
protected java.util.List _signers
protected java.util.List signerGens
protected java.util.Map digests
protected final java.security.SecureRandom rand
protected CMSSignedGenerator()
protected CMSSignedGenerator(java.security.SecureRandom rand)
rand
- instance of SecureRandom to useprotected java.lang.String getEncOID(java.security.PrivateKey key, java.lang.String digestOID)
protected java.util.Map getBaseParameters(org.bouncycastle.asn1.ASN1ObjectIdentifier contentType, org.bouncycastle.asn1.x509.AlgorithmIdentifier digAlgId, byte[] hash)
protected org.bouncycastle.asn1.ASN1Set getAttributeSet(org.bouncycastle.asn1.cms.AttributeTable attr)
public void addCertificatesAndCRLs(java.security.cert.CertStore certStore) throws java.security.cert.CertStoreException, CMSException
Note: this assumes the CertStore will support null in the get methods.
certStore
- CertStore containing the public key certificates and CRLsjava.security.cert.CertStoreException
- if an issue occurs processing the CertStoreCMSException
- if an issue occurse transforming data from the CertStore into the messagepublic void addCertificate(X509CertificateHolder certificate) throws CMSException
certificate
- the certificate to be included.CMSException
- if the certificate cannot be encoded for adding.public void addCertificates(org.bouncycastle.util.Store certStore) throws CMSException
certStore
- the store containing the certificates to be included.CMSException
- if the certificates cannot be encoded for adding.public void addCRL(X509CRLHolder crl)
crl
- the CRL to be included.public void addCRLs(org.bouncycastle.util.Store crlStore) throws CMSException
crlStore
- the store containing the CRLs to be included.CMSException
- if the CRLs cannot be encoded for adding.public void addAttributeCertificate(X509AttributeCertificateHolder attrCert) throws CMSException
attrCert
- the store containing the certificates to be included.CMSException
- if the attribute certificate cannot be encoded for adding.public void addAttributeCertificates(org.bouncycastle.util.Store attrStore) throws CMSException
attrStore
- the store containing the certificates to be included.CMSException
- if the attribute certificate cannot be encoded for adding.public void addOtherRevocationInfo(org.bouncycastle.asn1.ASN1ObjectIdentifier otherRevocationInfoFormat, org.bouncycastle.asn1.ASN1Encodable otherRevocationInfo)
otherRevocationInfoFormat
- the OID specifying the format of the otherRevocationInfo data.otherRevocationInfo
- the otherRevocationInfo ASN.1 structure.public void addOtherRevocationInfo(org.bouncycastle.asn1.ASN1ObjectIdentifier otherRevocationInfoFormat, org.bouncycastle.util.Store otherRevocationInfos)
otherRevocationInfoFormat
- the OID specifying the format of the otherRevocationInfo data.otherRevocationInfos
- a Store of otherRevocationInfo data to add.public void addAttributeCertificates(org.bouncycastle.x509.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 java.util.Map getGeneratedDigests()