|
Bouncy Castle Cryptography Library 1.42 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bouncycastle.cms.CMSSignedGenerator
org.bouncycastle.cms.CMSSignedDataGenerator
public class CMSSignedDataGenerator
general class for generating a pkcs7-signature message.
A simple example of usage.
CertStore certs... CMSSignedDataGenerator gen = new CMSSignedDataGenerator(); gen.addSigner(privKey, cert, CMSSignedGenerator.DIGEST_SHA1); gen.addCertificatesAndCRLs(certs); CMSSignedData data = gen.generate(content, "BC");
Field Summary |
---|
Fields inherited from class org.bouncycastle.cms.CMSSignedGenerator |
---|
_certs, _crls, _digests, _signers, DATA, DIGEST_GOST3411, DIGEST_MD5, DIGEST_RIPEMD128, DIGEST_RIPEMD160, DIGEST_RIPEMD256, DIGEST_SHA1, DIGEST_SHA224, DIGEST_SHA256, DIGEST_SHA384, DIGEST_SHA512, ENCRYPTION_DSA, ENCRYPTION_ECDSA, ENCRYPTION_ECGOST3410, ENCRYPTION_GOST3410, ENCRYPTION_RSA, ENCRYPTION_RSA_PSS, rand |
Constructor Summary | |
---|---|
CMSSignedDataGenerator()
base constructor |
|
CMSSignedDataGenerator(java.security.SecureRandom rand)
constructor allowing specific source of randomness |
Method Summary | |
---|---|
void |
addSigner(java.security.PrivateKey key,
byte[] subjectKeyID,
java.lang.String digestOID)
add a signer - no attributes other than the default ones will be provided here. |
void |
addSigner(java.security.PrivateKey key,
byte[] subjectKeyID,
java.lang.String digestOID,
org.bouncycastle.asn1.cms.AttributeTable signedAttr,
org.bouncycastle.asn1.cms.AttributeTable unsignedAttr)
add a signer with extra signed/unsigned attributes. |
void |
addSigner(java.security.PrivateKey key,
byte[] subjectKeyID,
java.lang.String digestOID,
CMSAttributeTableGenerator signedAttrGen,
CMSAttributeTableGenerator unsignedAttrGen)
add a signer with extra signed/unsigned attributes based on generators. |
void |
addSigner(java.security.PrivateKey key,
java.security.cert.X509Certificate cert,
java.lang.String digestOID)
add a signer - no attributes other than the default ones will be provided here. |
void |
addSigner(java.security.PrivateKey key,
java.security.cert.X509Certificate cert,
java.lang.String digestOID,
org.bouncycastle.asn1.cms.AttributeTable signedAttr,
org.bouncycastle.asn1.cms.AttributeTable unsignedAttr)
add a signer with extra signed/unsigned attributes. |
void |
addSigner(java.security.PrivateKey key,
java.security.cert.X509Certificate cert,
java.lang.String digestOID,
CMSAttributeTableGenerator signedAttrGen,
CMSAttributeTableGenerator unsignedAttrGen)
add a signer with extra signed/unsigned attributes based on generators. |
CMSSignedData |
generate(CMSProcessable content,
boolean encapsulate,
java.security.Provider sigProvider)
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". |
CMSSignedData |
generate(CMSProcessable content,
boolean encapsulate,
java.lang.String sigProvider)
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". |
CMSSignedData |
generate(CMSProcessable content,
java.security.Provider sigProvider)
generate a signed object that for a CMS Signed Data object using the given provider. |
CMSSignedData |
generate(CMSProcessable content,
java.lang.String sigProvider)
generate a signed object that for a CMS Signed Data object using the given provider. |
CMSSignedData |
generate(java.lang.String signedContentType,
CMSProcessable content,
boolean encapsulate,
java.security.Provider sigProvider)
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. |
CMSSignedData |
generate(java.lang.String signedContentType,
CMSProcessable content,
boolean encapsulate,
java.security.Provider sigProvider,
boolean addDefaultAttributes)
Similar method to the other generate methods. |
CMSSignedData |
generate(java.lang.String signedContentType,
CMSProcessable content,
boolean encapsulate,
java.lang.String sigProvider)
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. |
CMSSignedData |
generate(java.lang.String signedContentType,
CMSProcessable content,
boolean encapsulate,
java.lang.String sigProvider,
boolean addDefaultAttributes)
Similar method to the other generate methods. |
SignerInformationStore |
generateCounterSigners(SignerInformation signer,
java.security.Provider sigProvider)
generate a set of one or more SignerInformation objects representing counter signatures on the passed in SignerInformation object. |
SignerInformationStore |
generateCounterSigners(SignerInformation signer,
java.lang.String sigProvider)
generate a set of one or more SignerInformation objects representing counter signatures on the passed in SignerInformation object. |
Methods inherited from class org.bouncycastle.cms.CMSSignedGenerator |
---|
addAttributeCertificates, addCertificatesAndCRLs, addSigners, getAttributeSet, getBaseParameters, getEncAlgorithmIdentifier, getEncOID, getGeneratedDigests |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CMSSignedDataGenerator()
public CMSSignedDataGenerator(java.security.SecureRandom rand)
rand
- instance of SecureRandom to useMethod Detail |
---|
public void addSigner(java.security.PrivateKey key, java.security.cert.X509Certificate cert, java.lang.String digestOID) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void addSigner(java.security.PrivateKey key, byte[] subjectKeyID, java.lang.String digestOID) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void addSigner(java.security.PrivateKey key, java.security.cert.X509Certificate cert, java.lang.String digestOID, org.bouncycastle.asn1.cms.AttributeTable signedAttr, org.bouncycastle.asn1.cms.AttributeTable unsignedAttr) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void addSigner(java.security.PrivateKey key, byte[] subjectKeyID, java.lang.String digestOID, org.bouncycastle.asn1.cms.AttributeTable signedAttr, org.bouncycastle.asn1.cms.AttributeTable unsignedAttr) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void addSigner(java.security.PrivateKey key, java.security.cert.X509Certificate cert, java.lang.String digestOID, CMSAttributeTableGenerator signedAttrGen, CMSAttributeTableGenerator unsignedAttrGen) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void addSigner(java.security.PrivateKey key, byte[] subjectKeyID, java.lang.String digestOID, CMSAttributeTableGenerator signedAttrGen, CMSAttributeTableGenerator unsignedAttrGen) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public CMSSignedData generate(CMSProcessable content, java.lang.String sigProvider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, CMSException
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
CMSException
public CMSSignedData generate(CMSProcessable content, java.security.Provider sigProvider) throws java.security.NoSuchAlgorithmException, CMSException
java.security.NoSuchAlgorithmException
CMSException
public CMSSignedData generate(java.lang.String signedContentType, CMSProcessable content, boolean encapsulate, java.lang.String sigProvider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, CMSException
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
CMSException
public CMSSignedData generate(java.lang.String signedContentType, CMSProcessable content, boolean encapsulate, java.security.Provider sigProvider) throws java.security.NoSuchAlgorithmException, CMSException
java.security.NoSuchAlgorithmException
CMSException
public CMSSignedData generate(java.lang.String signedContentType, CMSProcessable content, boolean encapsulate, java.lang.String sigProvider, boolean addDefaultAttributes) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, CMSException
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
CMSException
public CMSSignedData generate(java.lang.String signedContentType, CMSProcessable content, boolean encapsulate, java.security.Provider sigProvider, boolean addDefaultAttributes) throws java.security.NoSuchAlgorithmException, CMSException
java.security.NoSuchAlgorithmException
CMSException
public CMSSignedData generate(CMSProcessable content, boolean encapsulate, java.lang.String sigProvider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, CMSException
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
CMSException
public CMSSignedData generate(CMSProcessable content, boolean encapsulate, java.security.Provider sigProvider) throws java.security.NoSuchAlgorithmException, CMSException
java.security.NoSuchAlgorithmException
CMSException
public SignerInformationStore generateCounterSigners(SignerInformation signer, java.security.Provider sigProvider) throws java.security.NoSuchAlgorithmException, CMSException
signer
- the signer to be countersignedsigProvider
- the provider to be used for counter signing.
java.security.NoSuchAlgorithmException
CMSException
public SignerInformationStore generateCounterSigners(SignerInformation signer, java.lang.String sigProvider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, CMSException
signer
- the signer to be countersignedsigProvider
- the provider to be used for counter signing.
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
CMSException
|
Bouncy Castle Cryptography Library 1.42 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |