public class DefaultDirectSignedDataGenerator extends Object implements DirectSignedDataGenerator
| Constructor and Description |
|---|
DefaultDirectSignedDataGenerator(String sigProvider)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCertificatesAndCRLs(CertStore certStore)
Adds signing certificates and CRLs to the message
|
void |
addSigner(PrivateKey key,
X509Certificate cert,
String digestOID,
org.bouncycastle.asn1.cms.AttributeTable signedAttr,
org.bouncycastle.asn1.cms.AttributeTable unsignedAttr)
Adds a message signer to the message.
|
org.bouncycastle.cms.CMSSignedData |
generate(org.bouncycastle.cms.CMSProcessable content)
Generates a CMSSignedData object that represents the content's digital signature.
|
public DefaultDirectSignedDataGenerator(String sigProvider)
sigProvider - The name of the JCE provider used to perform the signing and digest operations. If this is null or empty,
the CryptoExtensions.getJCESensitiveProviderName() value will be used.public void addSigner(PrivateKey key, X509Certificate cert, String digestOID, org.bouncycastle.asn1.cms.AttributeTable signedAttr, org.bouncycastle.asn1.cms.AttributeTable unsignedAttr) throws IllegalArgumentException
addSigner in interface DirectSignedDataGeneratorkey - The private key used to digitally sign the message.cert - The X.509 certificate whose public key matches up with the private key.digestOID - The digest algorithm used to generate the message hash.signedAttr - Signed attributesunsignedAttr - Unsigned attributes.IllegalArgumentExceptionpublic void addCertificatesAndCRLs(CertStore certStore) throws CertStoreException, org.bouncycastle.cms.CMSException
addCertificatesAndCRLs in interface DirectSignedDataGeneratorcertStore - A store or messgae signersCertStoreExceptionorg.bouncycastle.cms.CMSExceptionpublic org.bouncycastle.cms.CMSSignedData generate(org.bouncycastle.cms.CMSProcessable content)
throws NoSuchAlgorithmException,
NoSuchProviderException,
org.bouncycastle.cms.CMSException
generate in interface DirectSignedDataGeneratorcontent - The content to be signed.NoSuchAlgorithmExceptionNoSuchProviderExceptionorg.bouncycastle.cms.CMSExceptionCopyright © 2010-2016 NHIN Direct. All Rights Reserved.