java.lang.Object | ||
↳ | org.bouncycastle.cms.CMSSignedGenerator | |
↳ | org.bouncycastle.cms.CMSSignedDataStreamGenerator |
General class for generating a pkcs7-signature message stream.
A simple example of usage.
X509Certificate signCert = ... certList.add(signCert); Store certs = new JcaCertStore(certList); ContentSigner sha1Signer = new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(signKP.getPrivate()); CMSSignedDataStreamGenerator gen = new CMSSignedDataStreamGenerator(); gen.addSignerInfoGenerator( new JcaSignerInfoGeneratorBuilder( new JcaDigestCalculatorProviderBuilder().setProvider("BC").build()) .build(sha1Signer, signCert)); gen.addCertificates(certs); OutputStream sigOut = gen.open(bOut); sigOut.write("Hello World!".getBytes()); sigOut.close();
[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 addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignedInfoGenerator
| |||||||||||
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 addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
This method is deprecated.
use addSignedInfoGenerator
| |||||||||||
This method is deprecated.
use addSignerInfoGenerator
| |||||||||||
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.
| |||||||||||
generate a signed object that for a CMS Signed Data
object using the given provider.
| |||||||||||
This method is deprecated.
use open(ASN1ObjectIdenfier, OutputStream, boolean, OutputStream)
| |||||||||||
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.
| |||||||||||
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 - 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 open(ASN1ObjectIdentifier, OutputStream, boolean)
| |||||||||||
Set the underlying string size for encapsulated data
|
[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 addSignedInfoGenerator
add a signer, specifying the digest encryption algorithm - no attributes other than the default ones will be provided here.
NoSuchProviderException | |
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException | |
NoSuchAlgorithmException | |
NoSuchProviderException |
This method is deprecated.
use addSignedInfoGenerator
add a signer - no attributes other than the default ones will be provided here.
NoSuchProviderException | |
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException | |
NoSuchAlgorithmException | |
NoSuchProviderException |
This method is deprecated.
use addSignerInfoGenerator
This method is deprecated.
use addSignedInfoGenerator
add a signer - no attributes other than the default ones will be provided here.
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException | |
NoSuchAlgorithmException | |
NoSuchProviderException |
This method is deprecated.
use addSignedInfoGenerator
add a signer with extra signed/unsigned attributes.
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException | |
NoSuchAlgorithmException |
This method is deprecated.
use addSignedInfoGenerator
add a signer, specifying digest encryptionOID - no attributes other than the default ones will be provided here.
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException | |
NoSuchAlgorithmException | |
NoSuchProviderException |
This method is deprecated.
use addSignerInfoGenerator
This method is deprecated.
use addSignedInfoGenerator
add a signer - no attributes other than the default ones will be provided here.
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException | |
NoSuchAlgorithmException | |
NoSuchProviderException |
This method is deprecated.
use addSignedInfoGenerator
add a signer - no attributes other than the default ones will be provided here.
NoSuchProviderException | |
---|---|
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException |
This method is deprecated.
use addSignerInfoGenerator
This method is deprecated.
use addSignerInfoGenerator
add a signer with extra signed/unsigned attributes.
NoSuchProviderException | |
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException | |
NoSuchAlgorithmException | |
NoSuchProviderException |
This method is deprecated.
use addSignerInfoGenerator
add a signer with extra signed/unsigned attributes.
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException | |
NoSuchAlgorithmException |
This method is deprecated.
use addSignerInfoGenerator
This method is deprecated.
use addSignedInfoGenerator
This method is deprecated.
use addSignedInfoGenerator
add a signer with extra signed/unsigned attributes and the digest encryption algorithm.
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException | |
NoSuchAlgorithmException |
This method is deprecated.
use addSignedInfoGenerator
add a signer - no attributes other than the default ones will be provided here.
NoSuchProviderException | |
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException | |
NoSuchAlgorithmException | |
NoSuchProviderException |
This method is deprecated.
use addSignedInfoGenerator
add a signer with extra signed/unsigned attributes - specifying digest encryption algorithm.
NoSuchProviderException | |
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException | |
NoSuchAlgorithmException | |
NoSuchProviderException |
This method is deprecated.
use addSignedInfoGenerator
add a signer with extra signed/unsigned attributes.
NoSuchProviderException | |
---|---|
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException |
This method is deprecated.
use addSignedInfoGenerator
This method is deprecated.
use addSignedInfoGenerator
This method is deprecated.
use addSignerInfoGenerator
add a signer - no attributes other than the default ones will be provided here, specifying the digest encryption algorithm.
NoSuchAlgorithmException | |
InvalidKeyException | |
InvalidKeyException | |
NoSuchAlgorithmException | |
NoSuchProviderException |
This method is deprecated.
use addSignerInfoGenerator
This method is deprecated.
use addSignedInfoGenerator
This method is deprecated.
use addSignerInfoGenerator
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.
IOException |
---|
generate a signed object that for a CMS Signed Data object using the given provider.
IOException |
---|
This method is deprecated.
use open(ASN1ObjectIdenfier, OutputStream, boolean, OutputStream)
IOException |
---|
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.
eContentType | OID for data to be signed. |
---|---|
out | stream the CMS object is to be written to. |
encapsulate | true if data should be encapsulated. |
dataOutputStream | output stream to copy the data being signed to. |
IOException |
---|
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". If dataOutputStream is non null the data being signed will be written to the stream as it is processed.
out | stream the CMS object is to be written to. |
---|---|
encapsulate | true if data should be encapsulated. |
dataOutputStream | output stream to copy the data being signed to. |
IOException |
---|
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".
IOException |
---|
Set the underlying string size for encapsulated data
bufferSize | length of octet strings to buffer the data. |
---|