Class CMSSignedDataBuilder
java.lang.Object
eu.europa.esig.dss.cades.signature.CMSSignedDataBuilder
Builds a CMSSignedData
-
Constructor Summary
ConstructorDescriptionCMSSignedDataBuilder
(CertificateVerifier certificateVerifier) This is the default constructor forCMSSignedDataGeneratorBuilder
. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.bouncycastle.cms.CMSSignedDataGenerator
createCMSSignedDataGenerator
(CAdESSignatureParameters parameters, org.bouncycastle.operator.ContentSigner contentSigner, org.bouncycastle.cms.SignerInfoGeneratorBuilder signerInfoGeneratorBuilder, org.bouncycastle.cms.CMSSignedData originalSignedData) Note: Section 5.1 of RFC 3852 [4] requires that, the CMS SignedData version be set to 3 if certificates from SignedData is present AND (any version 1 attribute certificates are present OR any SignerInfo structures are version 3 OR eContentType from encapContentInfo is other than id-data).org.bouncycastle.cms.CMSSignedData
extendCMSSignedData
(org.bouncycastle.cms.CMSSignedData cmsSignedData, ValidationData validationDataForInclusion) Extends the providedcmsSignedData
with the required validation data
-
Constructor Details
-
CMSSignedDataBuilder
This is the default constructor forCMSSignedDataGeneratorBuilder
. TheCertificateVerifier
is used to find the trusted certificates.- Parameters:
certificateVerifier
-CertificateVerifier
provides information on the sources to be used in the validation process in the context of a signature.
-
-
Method Details
-
createCMSSignedDataGenerator
protected org.bouncycastle.cms.CMSSignedDataGenerator createCMSSignedDataGenerator(CAdESSignatureParameters parameters, org.bouncycastle.operator.ContentSigner contentSigner, org.bouncycastle.cms.SignerInfoGeneratorBuilder signerInfoGeneratorBuilder, org.bouncycastle.cms.CMSSignedData originalSignedData) Note: Section 5.1 of RFC 3852 [4] requires that, the CMS SignedData version be set to 3 if certificates from SignedData is present AND (any version 1 attribute certificates are present OR any SignerInfo structures are version 3 OR eContentType from encapContentInfo is other than id-data). Otherwise, the CMS SignedData version is required to be set to 1. CMS SignedData Version is handled automatically by BouncyCastle.- Parameters:
parameters
- set of the driving signing parameterscontentSigner
- the contentSigner to get the hash of the data to be signedsignerInfoGeneratorBuilder
- the builder for the signer info generatororiginalSignedData
- the original signed data if extending an existing signature. null otherwise.- Returns:
- the bouncycastle signed data generator which signs the document and adds the required signed and unsigned CMS attributes
-
extendCMSSignedData
public org.bouncycastle.cms.CMSSignedData extendCMSSignedData(org.bouncycastle.cms.CMSSignedData cmsSignedData, ValidationData validationDataForInclusion) Extends the providedcmsSignedData
with the required validation data- Parameters:
cmsSignedData
-CMSSignedData
to be extendedvalidationDataForInclusion
- theValidationData
to be included into the cmsSignedData- Returns:
- extended
CMSSignedData
-