Package org.bouncycastle.cms
Class CMSSignedGenerator
- java.lang.Object
-
- org.bouncycastle.cms.CMSSignedGenerator
-
- Direct Known Subclasses:
CMSSignedDataGenerator,CMSSignedDataStreamGenerator
public class CMSSignedGenerator extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List_signersprotected java.util.Listcertsprotected java.util.Listcrlsstatic java.lang.StringDATADefault type for the signed data.static java.lang.StringDIGEST_GOST3411static java.lang.StringDIGEST_MD5static java.lang.StringDIGEST_RIPEMD128static java.lang.StringDIGEST_RIPEMD160static java.lang.StringDIGEST_RIPEMD256static java.lang.StringDIGEST_SHA1static java.lang.StringDIGEST_SHA224static java.lang.StringDIGEST_SHA256static java.lang.StringDIGEST_SHA384static java.lang.StringDIGEST_SHA512protected java.util.Mapdigestsstatic java.lang.StringENCRYPTION_DSAstatic java.lang.StringENCRYPTION_ECDSAstatic java.lang.StringENCRYPTION_ECGOST3410static java.lang.StringENCRYPTION_ECGOST3410_2012_256static java.lang.StringENCRYPTION_ECGOST3410_2012_512static java.lang.StringENCRYPTION_GOST3410static java.lang.StringENCRYPTION_RSAstatic java.lang.StringENCRYPTION_RSA_PSSprotected java.util.ListsignerGens
-
Constructor Summary
Constructors Modifier Constructor Description protectedCMSSignedGenerator()base constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttributeCertificate(X509AttributeCertificateHolder attrCert)Add the attribute certificates in attrStore to the certificate set to be included with the generated SignedData message.voidaddAttributeCertificates(org.bouncycastle.util.Store attrStore)Add the attribute certificates in attrStore to the certificate set to be included with the generated SignedData message.voidaddCertificate(X509CertificateHolder certificate)Add a certificate to the certificate set to be included with the generated SignedData message.voidaddCertificates(org.bouncycastle.util.Store certStore)Add the certificates in certStore to the certificate set to be included with the generated SignedData message.voidaddCRL(X509CRLHolder crl)Add a CRL to the CRL set to be included with the generated SignedData message.voidaddCRLs(org.bouncycastle.util.Store crlStore)Add the CRLs in crlStore to the CRL set to be included with the generated SignedData message.voidaddOtherRevocationInfo(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.voidaddOtherRevocationInfo(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.voidaddSignerInfoGenerator(SignerInfoGenerator infoGen)Add a generator for a particular signer to this CMS SignedData generator.voidaddSigners(SignerInformationStore signerStore)Add a store of pre-calculated signers to the generator.protected java.util.MapgetBaseParameters(org.bouncycastle.asn1.ASN1ObjectIdentifier contentType, org.bouncycastle.asn1.x509.AlgorithmIdentifier digAlgId, byte[] hash)java.util.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 java.lang.String DATA
Default type for the signed data.
-
DIGEST_SHA1
public static final java.lang.String DIGEST_SHA1
-
DIGEST_SHA224
public static final java.lang.String DIGEST_SHA224
-
DIGEST_SHA256
public static final java.lang.String DIGEST_SHA256
-
DIGEST_SHA384
public static final java.lang.String DIGEST_SHA384
-
DIGEST_SHA512
public static final java.lang.String DIGEST_SHA512
-
DIGEST_MD5
public static final java.lang.String DIGEST_MD5
-
DIGEST_GOST3411
public static final java.lang.String DIGEST_GOST3411
-
DIGEST_RIPEMD128
public static final java.lang.String DIGEST_RIPEMD128
-
DIGEST_RIPEMD160
public static final java.lang.String DIGEST_RIPEMD160
-
DIGEST_RIPEMD256
public static final java.lang.String DIGEST_RIPEMD256
-
ENCRYPTION_RSA
public static final java.lang.String ENCRYPTION_RSA
-
ENCRYPTION_DSA
public static final java.lang.String ENCRYPTION_DSA
-
ENCRYPTION_ECDSA
public static final java.lang.String ENCRYPTION_ECDSA
-
ENCRYPTION_RSA_PSS
public static final java.lang.String ENCRYPTION_RSA_PSS
-
ENCRYPTION_GOST3410
public static final java.lang.String ENCRYPTION_GOST3410
-
ENCRYPTION_ECGOST3410
public static final java.lang.String ENCRYPTION_ECGOST3410
-
ENCRYPTION_ECGOST3410_2012_256
public static final java.lang.String ENCRYPTION_ECGOST3410_2012_256
-
ENCRYPTION_ECGOST3410_2012_512
public static final java.lang.String ENCRYPTION_ECGOST3410_2012_512
-
certs
protected java.util.List certs
-
crls
protected java.util.List crls
-
_signers
protected java.util.List _signers
-
signerGens
protected java.util.List signerGens
-
digests
protected java.util.Map digests
-
-
Method Detail
-
getBaseParameters
protected java.util.Map getBaseParameters(org.bouncycastle.asn1.ASN1ObjectIdentifier contentType, org.bouncycastle.asn1.x509.AlgorithmIdentifier digAlgId, byte[] hash)
-
addCertificate
public void addCertificate(X509CertificateHolder certificate) throws CMSException
Add a certificate to the certificate set to be included with the generated SignedData message.- Parameters:
certificate- the certificate to be included.- Throws:
CMSException- if the certificate cannot be encoded for adding.
-
addCertificates
public void addCertificates(org.bouncycastle.util.Store certStore) throws CMSExceptionAdd the certificates in certStore to the certificate set to be included with the generated SignedData message.- Parameters:
certStore- the store containing the certificates to be included.- Throws:
CMSException- if the certificates cannot be encoded for adding.
-
addCRL
public void addCRL(X509CRLHolder crl)
Add a CRL to the CRL set to be included with the generated SignedData message.- Parameters:
crl- the CRL to be included.
-
addCRLs
public void addCRLs(org.bouncycastle.util.Store crlStore) throws CMSExceptionAdd the CRLs in crlStore to the CRL set to be included with the generated SignedData message.- Parameters:
crlStore- the store containing the CRLs to be included.- Throws:
CMSException- if the CRLs cannot be encoded for adding.
-
addAttributeCertificate
public void addAttributeCertificate(X509AttributeCertificateHolder attrCert) throws CMSException
Add the attribute certificates in attrStore to the certificate set to be included with the generated SignedData message.- Parameters:
attrCert- the store containing the certificates to be included.- Throws:
CMSException- if the attribute certificate cannot be encoded for adding.
-
addAttributeCertificates
public void addAttributeCertificates(org.bouncycastle.util.Store attrStore) throws CMSExceptionAdd the attribute certificates in attrStore to the certificate set to be included with the generated SignedData message.- Parameters:
attrStore- the store containing the certificates to be included.- Throws:
CMSException- if the attribute certificate cannot be encoded for adding.
-
addOtherRevocationInfo
public 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.- Parameters:
otherRevocationInfoFormat- the OID specifying the format of the otherRevocationInfo data.otherRevocationInfo- the otherRevocationInfo ASN.1 structure.
-
addOtherRevocationInfo
public 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.- Parameters:
otherRevocationInfoFormat- the OID specifying the format of the otherRevocationInfo data.otherRevocationInfos- a Store of otherRevocationInfo data to add.
-
addSigners
public void addSigners(SignerInformationStore signerStore)
Add a store of pre-calculated signers to the generator.- Parameters:
signerStore- store of signers
-
addSignerInfoGenerator
public void addSignerInfoGenerator(SignerInfoGenerator infoGen)
Add a generator for a particular signer to this CMS SignedData generator.- Parameters:
infoGen- the generator representing the particular signer.
-
getGeneratedDigests
public java.util.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.
-
-