java.lang.Object | ||
↳ | org.bouncycastle.cms.CMSSignedGenerator | |
↳ | org.bouncycastle.cms.CMSSignedDataGenerator |
general class for generating a pkcs7-signature message.
A simple example of usage, generating a detached signature.
List certList = new ArrayList(); CMSTypedData msg = new CMSProcessableByteArray("Hello world!".getBytes()); certList.add(signCert); Store certs = new JcaCertStore(certList); CMSSignedDataGenerator gen = new CMSSignedDataGenerator(); ContentSigner sha1Signer = new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(signKP.getPrivate()); gen.addSignerInfoGenerator( new JcaSignerInfoGeneratorBuilder( new JcaDigestCalculatorProviderBuilder().setProvider("BC").build()) .build(sha1Signer, signCert)); gen.addCertificates(certs); CMSSignedData sigData = gen.generate(msg, false);
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.bouncycastle.cms.CMSSignedGenerator
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
base constructor
| |||||||||||
constructor allowing specific source of randomness
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
generate a signed object that for a CMS Signed Data
object using the given provider.
| |||||||||||
Similar method to the other generate methods.
| |||||||||||
This method is deprecated.
use generate(CMSTypedData, boolean)
| |||||||||||
This method is deprecated.
use generate(CMSTypedData, boolean)
| |||||||||||
generate a signed object that for a CMS Signed Data
object using the given provider.
| |||||||||||
This method is deprecated.
use generate(CMSTypedData, boolean)
| |||||||||||
This method is deprecated.
use generate(CMSTypedData, boolean)
| |||||||||||
This method is deprecated.
use generate(CMSTypedData, boolean)
| |||||||||||
This method is deprecated.
use generateCounterSigners(SignerInformation)
| |||||||||||
generate a set of one or more SignerInformation objects representing counter signatures on
the passed in SignerInformation object.
| |||||||||||
This method is deprecated.
use generateCounterSigners(SignerInformation)
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.bouncycastle.cms.CMSSignedGenerator
| |||||||||||
From class
java.lang.Object
|
base constructor
constructor allowing specific source of randomness
rand | instance of SecureRandom to use |
---|
This method is deprecated.
use addSignerInfoGenerator
add a signer with extra signed/unsigned attributes based on generators.
IllegalArgumentException |
---|
This method is deprecated.
use addSignerInfoGenerator
add a signer, specifying the digest encryption algorithm, with extra signed/unsigned attributes.
key | signing key to use |
---|---|
cert | certificate containing corresponding public key |
encryptionOID | digest encryption algorithm OID |
digestOID | digest algorithm OID |
signedAttr | table of attributes to be included in signature |
unsignedAttr | table of attributes to be included as unsigned |
IllegalArgumentException |
---|
This method is deprecated.
use addSignerInfoGenerator
add a signer, including digest encryption algorithm, with extra signed/unsigned attributes based on generators.
IllegalArgumentException |
---|
This method is deprecated.
use addSignerInfoGenerator
add a signer, specifying the digest encryption algorithm, with extra signed/unsigned attributes.
key | signing key to use |
---|---|
subjectKeyID | subjectKeyID of corresponding public key |
encryptionOID | digest encryption algorithm OID |
digestOID | digest algorithm OID |
signedAttr | table of attributes to be included in signature |
unsignedAttr | table of attributes to be included as unsigned |
IllegalArgumentException |
---|
This method is deprecated.
use addSignerInfoGenerator
add a signer - no attributes other than the default ones will be provided here.
key | signing key to use |
---|---|
cert | certificate containing corresponding public key |
digestOID | digest algorithm OID |
IllegalArgumentException |
---|
This method is deprecated.
use addSignerInfoGenerator
add a signer, specifying the digest encryption algorithm, with extra signed/unsigned attributes based on generators.
IllegalArgumentException |
---|
This method is deprecated.
use addSignerInfoGenerator
add a signer, specifying the digest encryption algorithm to use - no attributes other than the default ones will be provided here.
key | signing key to use |
---|---|
cert | certificate containing corresponding public key |
encryptionOID | digest encryption algorithm OID |
digestOID | digest algorithm OID |
IllegalArgumentException |
---|
This method is deprecated.
use addSignerInfoGenerator
add a signer with extra signed/unsigned attributes based on generators.
IllegalArgumentException |
---|
This method is deprecated.
use addSignerInfoGenerator
add a signer with extra signed/unsigned attributes.
key | signing key to use |
---|---|
subjectKeyID | subjectKeyID of corresponding public key |
digestOID | digest algorithm OID |
signedAttr | table of attributes to be included in signature |
unsignedAttr | table of attributes to be included as unsigned |
IllegalArgumentException |
---|
This method is deprecated.
use addSignerInfoGenerator
add a signer, specifying the digest encryption algorithm to use - no attributes other than the default ones will be provided here.
IllegalArgumentException |
---|
This method is deprecated.
use addSignerInfoGenerator
add a signer - no attributes other than the default ones will be provided here.
IllegalArgumentException |
---|
This method is deprecated.
use addSignerInfoGenerator
add a signer with extra signed/unsigned attributes.
key | signing key to use |
---|---|
cert | certificate containing corresponding public key |
digestOID | digest algorithm OID |
signedAttr | table of attributes to be included in signature |
unsignedAttr | table of attributes to be included as unsigned |
IllegalArgumentException |
---|
generate a signed object that for a CMS Signed Data object using the given provider.
Similar method to the other generate methods. The additional argument addDefaultAttributes indicates whether or not a default set of signed attributes need to be added automatically. If the argument is set to false, no attributes will get added at all.
This method is deprecated.
use generate(CMSTypedData, boolean)
generate a signed object that for a CMS Signed Data object using the given provider - if encapsulate is true a copy of the message will be included in the signature. The content type is set according to the OID represented by the string signedContentType.
This method is deprecated.
use generate(CMSTypedData, boolean)
generate a signed object that for a CMS Signed Data object using the given provider - if encapsulate is true a copy of the message will be included in the signature with the default content type "data".
generate a signed object that for a CMS Signed Data object using the given provider.
This method is deprecated.
use generate(CMSTypedData, boolean)
generate a signed object that for a CMS Signed Data object using the given provider - if encapsulate is true a copy of the message will be included in the signature. The content type is set according to the OID represented by the string signedContentType.
This method is deprecated.
use generate(CMSTypedData, boolean)
Similar method to the other generate methods. The additional argument addDefaultAttributes indicates whether or not a default set of signed attributes need to be added automatically. If the argument is set to false, no attributes will get added at all.
This method is deprecated.
use generate(CMSTypedData, boolean)
generate a signed object that for a CMS Signed Data object using the given provider - if encapsulate is true a copy of the message will be included in the signature with the default content type "data".
This method is deprecated.
use generateCounterSigners(SignerInformation)
generate a set of one or more SignerInformation objects representing counter signatures on the passed in SignerInformation object.
signer | the signer to be countersigned |
---|---|
sigProvider | the provider to be used for counter signing. |
generate a set of one or more SignerInformation objects representing counter signatures on the passed in SignerInformation object.
signer | the signer to be countersigned |
---|
This method is deprecated.
use generateCounterSigners(SignerInformation)
generate a set of one or more SignerInformation objects representing counter signatures on the passed in SignerInformation object.
signer | the signer to be countersigned |
---|---|
sigProvider | the provider to be used for counter signing. |