public class CMSSignedDataGenerator extends CMSSignedGenerator
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, GammaTechProvider.PROVIDER_NAME);
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
CMSSignedDataGenerator.DigOutputStream |
private class |
CMSSignedDataGenerator.SignerInf |
(package private) static class |
CMSSignedDataGenerator.SigOutputStream |
| Modifier and Type | Field and Description |
|---|---|
(package private) boolean |
isCertexCMS |
(package private) java.util.List |
signerInfs |
_certs, _crls, _digests, _signers, DATA, DIGEST_GOST3411, DIGEST_GOST3411_2012_256, DIGEST_GOST3411_2012_512, DIGEST_GOST3411G, DIGEST_KZ_GOST_34_11_95, DIGEST_KZ_GOST_34_11_95_TEST, DIGEST_MD5, DIGEST_SHA1, ENCRYPTION_DSA, ENCRYPTION_ECDSA, ENCRYPTION_ECGOST3410, ENCRYPTION_GOST3410, ENCRYPTION_GOST3410_2012, ENCRYPTION_GOST3410_2012_2, ENCRYPTION_KZ_GOST_34_310_SIGNATURE, ENCRYPTION_RECGOST3410, ENCRYPTION_RSA, ENCRYPTION_RSA_PSS| Constructor and Description |
|---|
CMSSignedDataGenerator()
base constructor
|
| Modifier and Type | Method and Description |
|---|---|
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,
AttributeTable signedAttr,
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.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.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.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.
|
private AlgorithmIdentifier |
makeAlgId(java.lang.String oid,
byte[] params) |
private DERObject |
makeObj(byte[] encoding) |
addAttributeCertificates, addCertificatesAndCRLs, addSigners, getAttributeSet, getBaseParameters, getEncAlgorithmIdentifier, getEncOID, getGeneratedDigestspublic void addSigner(java.security.PrivateKey key,
java.security.cert.X509Certificate cert,
java.lang.String digestOID)
throws java.lang.IllegalArgumentException
key - - key for signingcert - - certificate of the key for signingdigestOID - - OID of digest algorithmjava.lang.IllegalArgumentExceptionpublic void addSigner(java.security.PrivateKey key,
java.security.cert.X509Certificate cert,
java.lang.String digestOID,
AttributeTable signedAttr,
AttributeTable unsignedAttr)
throws java.lang.IllegalArgumentException
key - - key for signingcert - - certificate of the key for signingdigestOID - - OID of digest algorithmsignedAttr - - collection of attributes that are signed. Additional information can be included here,
for example - signing time, content type, Transaction ID, etc..unsignedAttr - - collection of attributes that are not signedjava.lang.IllegalArgumentExceptionpublic void addSigner(java.security.PrivateKey key,
java.security.cert.X509Certificate cert,
java.lang.String digestOID,
CMSAttributeTableGenerator signedAttrGen,
CMSAttributeTableGenerator unsignedAttrGen)
throws java.lang.IllegalArgumentException
key - - key for signingcert - - certificate of the key for signingdigestOID - - OID of digest algorithmsignedAttrGen - - collection of attributes that are signed. Additional information can be included here,
for example - signing time, content type, Transaction ID, etc..unsignedAttrGen - - collection of attributes that are not signedjava.lang.IllegalArgumentExceptionprivate DERObject makeObj(byte[] encoding) throws java.io.IOException
java.io.IOExceptionprivate AlgorithmIdentifier makeAlgId(java.lang.String oid, byte[] params) throws java.io.IOException
java.io.IOExceptionpublic CMSSignedData generate(CMSProcessable content, java.lang.String sigProvider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, CMSException
java.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionCMSExceptionpublic CMSSignedData generate(java.lang.String signedContentType, CMSProcessable content, boolean encapsulate, java.lang.String sigProvider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, CMSException
java.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionCMSExceptionpublic 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.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionCMSExceptionpublic CMSSignedData generate(CMSProcessable content, boolean encapsulate, java.lang.String sigProvider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, CMSException
java.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionCMSExceptionCopyright © 1998-2014 Gamma Technologies. All Rights Reserved.