Class CMSSignerInfoGeneratorBuilder
java.lang.Object
eu.europa.esig.dss.cms.CMSSignerInfoGeneratorBuilder
This class is used to build an instance of
org.bouncycastle.cms.SignerInfoGenerator-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DigestAlgorithmDigest algorithm to be used on message-digest computationprotected org.bouncycastle.asn1.cms.AttributeTableAttributes to be signedprotected CertificateTokenThe signing-certificate of the signerprotected org.bouncycastle.asn1.cms.AttributeTableUnsigned attributes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.cms.SignerInfoGeneratorbuild(DSSDocument toSignDocument, org.bouncycastle.operator.ContentSigner contentSigner) Builds aSignerInfoGeneratorfor signing atoSignDocumentorg.bouncycastle.cms.SignerInfoGeneratorbuild(org.bouncycastle.operator.ContentSigner contentSigner) Builds aSignerInfoGeneratorwith no original document providedprotected org.bouncycastle.operator.DigestCalculatorProvidergetDigestCalculatorProvider(DSSDocument toSignDocument) Returns aDigestCalculatorProviderprotected org.bouncycastle.cms.SignerInfoGeneratorBuildergetSignerInfoGeneratorBuilder(org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider) This method creates a builder of SignerInfoGeneratorsetDigestAlgorithm(DigestAlgorithm digestAlgorithm) Sets the Digest Algorithm to be used on message-digest computationsetSignedAttributes(org.bouncycastle.asn1.cms.AttributeTable signedAttributes) Sets the signed attributessetSigningCertificate(CertificateToken signingCertificate) Sets the signing-certificate of the signersetUnsignedAttributes(org.bouncycastle.asn1.cms.AttributeTable unsignedAttributes) Sets the unsigned attributes
-
Field Details
-
signingCertificate
The signing-certificate of the signer -
digestAlgorithm
Digest algorithm to be used on message-digest computation -
signedAttributes
protected org.bouncycastle.asn1.cms.AttributeTable signedAttributesAttributes to be signed -
unsignedAttributes
protected org.bouncycastle.asn1.cms.AttributeTable unsignedAttributesUnsigned attributes
-
-
Constructor Details
-
CMSSignerInfoGeneratorBuilder
public CMSSignerInfoGeneratorBuilder()Default constructor
-
-
Method Details
-
setSigningCertificate
Sets the signing-certificate of the signer- Parameters:
signingCertificate-CertificateToken- Returns:
- this
CMSSignerInfoGeneratorBuilder
-
setDigestAlgorithm
Sets the Digest Algorithm to be used on message-digest computation- Parameters:
digestAlgorithm-DigestAlgorithm- Returns:
- this
CMSSignerInfoGeneratorBuilder
-
setSignedAttributes
public CMSSignerInfoGeneratorBuilder setSignedAttributes(org.bouncycastle.asn1.cms.AttributeTable signedAttributes) Sets the signed attributes- Parameters:
signedAttributes-AttributeTable- Returns:
- this
CMSSignerInfoGeneratorBuilder
-
setUnsignedAttributes
public CMSSignerInfoGeneratorBuilder setUnsignedAttributes(org.bouncycastle.asn1.cms.AttributeTable unsignedAttributes) Sets the unsigned attributes- Parameters:
unsignedAttributes-AttributeTable- Returns:
- this
CMSSignerInfoGeneratorBuilder
-
build
public org.bouncycastle.cms.SignerInfoGenerator build(org.bouncycastle.operator.ContentSigner contentSigner) Builds aSignerInfoGeneratorwith no original document provided- Parameters:
contentSigner-ContentSigner- Returns:
SignerInfoGenerator
-
build
public org.bouncycastle.cms.SignerInfoGenerator build(DSSDocument toSignDocument, org.bouncycastle.operator.ContentSigner contentSigner) Builds aSignerInfoGeneratorfor signing atoSignDocument- Parameters:
toSignDocument-DSSDocumentto be signedcontentSigner-ContentSigner- Returns:
SignerInfoGenerator
-
getDigestCalculatorProvider
protected org.bouncycastle.operator.DigestCalculatorProvider getDigestCalculatorProvider(DSSDocument toSignDocument) Returns aDigestCalculatorProvider- Parameters:
toSignDocument-DSSDocumentto sign- Returns:
DigestCalculatorProvider
-
getSignerInfoGeneratorBuilder
protected org.bouncycastle.cms.SignerInfoGeneratorBuilder getSignerInfoGeneratorBuilder(org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider) This method creates a builder of SignerInfoGenerator- Parameters:
digestCalculatorProvider- the digest calculator (can be pre-computed)- Returns:
- a SignerInfoGeneratorBuilder that generate the signed and unsigned attributes according to the parameters
-