|
Bouncy Castle Cryptography 1.46 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bouncycastle.cms.CMSSignedGenerator org.bouncycastle.cms.CMSSignedDataGenerator
public class 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);
Field Summary |
---|
Fields inherited from class org.bouncycastle.cms.CMSSignedGenerator |
---|
_signers, certs, crls, DATA, DIGEST_GOST3411, DIGEST_MD5, DIGEST_RIPEMD128, DIGEST_RIPEMD160, DIGEST_RIPEMD256, DIGEST_SHA1, DIGEST_SHA224, DIGEST_SHA256, DIGEST_SHA384, DIGEST_SHA512, digests, ENCRYPTION_DSA, ENCRYPTION_ECDSA, ENCRYPTION_ECGOST3410, ENCRYPTION_GOST3410, ENCRYPTION_RSA, ENCRYPTION_RSA_PSS, rand, signerGens |
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)
Deprecated. use addSignerInfoGenerator |
void |
addSigner(java.security.PrivateKey key,
byte[] subjectKeyID,
java.lang.String digestOID,
AttributeTable signedAttr,
AttributeTable unsignedAttr)
Deprecated. use addSignerInfoGenerator |
void |
addSigner(java.security.PrivateKey key,
byte[] subjectKeyID,
java.lang.String encryptionOID,
java.lang.String digestOID)
Deprecated. use addSignerInfoGenerator |
void |
addSigner(java.security.PrivateKey key,
byte[] subjectKeyID,
java.lang.String encryptionOID,
java.lang.String digestOID,
AttributeTable signedAttr,
AttributeTable unsignedAttr)
Deprecated. use addSignerInfoGenerator |
void |
addSigner(java.security.PrivateKey key,
java.security.cert.X509Certificate cert,
java.lang.String digestOID)
Deprecated. use addSignerInfoGenerator |
void |
addSigner(java.security.PrivateKey key,
java.security.cert.X509Certificate cert,
java.lang.String digestOID,
AttributeTable signedAttr,
AttributeTable unsignedAttr)
Deprecated. use addSignerInfoGenerator |
void |
addSigner(java.security.PrivateKey key,
java.security.cert.X509Certificate cert,
java.lang.String encryptionOID,
java.lang.String digestOID)
Deprecated. use addSignerInfoGenerator |
void |
addSigner(java.security.PrivateKey key,
java.security.cert.X509Certificate cert,
java.lang.String encryptionOID,
java.lang.String digestOID,
AttributeTable signedAttr,
AttributeTable unsignedAttr)
Deprecated. use addSignerInfoGenerator |
CMSSignedData |
generate(CMSProcessable content,
boolean encapsulate,
java.security.Provider sigProvider)
Deprecated. use generate(CMSTypedData, boolean) |
CMSSignedData |
generate(CMSProcessable content,
boolean encapsulate,
java.lang.String sigProvider)
Deprecated. use generate(CMSTypedData, boolean) |
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(CMSTypedData content)
|
CMSSignedData |
generate(CMSTypedData content,
boolean encapsulate)
|
CMSSignedData |
generate(java.lang.String eContentType,
CMSProcessable content,
boolean encapsulate,
java.security.Provider sigProvider)
Deprecated. use generate(CMSTypedData, boolean) |
CMSSignedData |
generate(java.lang.String eContentType,
CMSProcessable content,
boolean encapsulate,
java.security.Provider sigProvider,
boolean addDefaultAttributes)
Similar method to the other generate methods. |
CMSSignedData |
generate(java.lang.String eContentType,
CMSProcessable content,
boolean encapsulate,
java.lang.String sigProvider)
Deprecated. use generate(CMSTypedData, boolean) |
CMSSignedData |
generate(java.lang.String eContentType,
CMSProcessable content,
boolean encapsulate,
java.lang.String sigProvider,
boolean addDefaultAttributes)
Deprecated. use generate(CMSTypedData, boolean) |
SignerInformationStore |
generateCounterSigners(SignerInformation signer)
generate a set of one or more SignerInformation objects representing counter signatures on the passed in SignerInformation object. |
SignerInformationStore |
generateCounterSigners(SignerInformation signer,
java.security.Provider sigProvider)
Deprecated. use generateCounterSigners(SignerInformation) |
SignerInformationStore |
generateCounterSigners(SignerInformation signer,
java.lang.String sigProvider)
Deprecated. use generateCounterSigners(SignerInformation) |
Methods inherited from class org.bouncycastle.cms.CMSSignedGenerator |
---|
addAttributeCertificates, addAttributeCertificates, addCertificates, addCertificatesAndCRLs, addCRLs, addSignerInfoGenerator, 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
key
- signing key to usecert
- certificate containing corresponding public keydigestOID
- digest algorithm OID
java.lang.IllegalArgumentException
public void addSigner(java.security.PrivateKey key, java.security.cert.X509Certificate cert, java.lang.String encryptionOID, java.lang.String digestOID) throws java.lang.IllegalArgumentException
key
- signing key to usecert
- certificate containing corresponding public keyencryptionOID
- digest encryption algorithm OIDdigestOID
- digest algorithm OID
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, byte[] subjectKeyID, java.lang.String encryptionOID, 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, AttributeTable signedAttr, AttributeTable unsignedAttr) throws java.lang.IllegalArgumentException
key
- signing key to usecert
- certificate containing corresponding public keydigestOID
- digest algorithm OIDsignedAttr
- table of attributes to be included in signatureunsignedAttr
- table of attributes to be included as unsigned
java.lang.IllegalArgumentException
public void addSigner(java.security.PrivateKey key, java.security.cert.X509Certificate cert, java.lang.String encryptionOID, java.lang.String digestOID, AttributeTable signedAttr, AttributeTable unsignedAttr) throws java.lang.IllegalArgumentException
key
- signing key to usecert
- certificate containing corresponding public keyencryptionOID
- digest encryption algorithm OIDdigestOID
- digest algorithm OIDsignedAttr
- table of attributes to be included in signatureunsignedAttr
- table of attributes to be included as unsigned
java.lang.IllegalArgumentException
public void addSigner(java.security.PrivateKey key, byte[] subjectKeyID, java.lang.String digestOID, AttributeTable signedAttr, AttributeTable unsignedAttr) throws java.lang.IllegalArgumentException
key
- signing key to usesubjectKeyID
- subjectKeyID of corresponding public keydigestOID
- digest algorithm OIDsignedAttr
- table of attributes to be included in signatureunsignedAttr
- table of attributes to be included as unsigned
java.lang.IllegalArgumentException
public void addSigner(java.security.PrivateKey key, byte[] subjectKeyID, java.lang.String encryptionOID, java.lang.String digestOID, AttributeTable signedAttr, AttributeTable unsignedAttr) throws java.lang.IllegalArgumentException
key
- signing key to usesubjectKeyID
- subjectKeyID of corresponding public keyencryptionOID
- digest encryption algorithm OIDdigestOID
- digest algorithm OIDsignedAttr
- table of attributes to be included in signatureunsignedAttr
- table of attributes to be included as unsigned
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 eContentType, 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 eContentType, CMSProcessable content, boolean encapsulate, java.security.Provider sigProvider) throws java.security.NoSuchAlgorithmException, CMSException
java.security.NoSuchAlgorithmException
CMSException
public CMSSignedData generate(java.lang.String eContentType, 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 eContentType, 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 CMSSignedData generate(CMSTypedData content) throws CMSException
CMSException
public CMSSignedData generate(CMSTypedData content, boolean encapsulate) throws CMSException
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
public SignerInformationStore generateCounterSigners(SignerInformation signer) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, CMSException
signer
- the signer to be countersigned
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
CMSException
|
Bouncy Castle Cryptography 1.46 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |