Class CMSSignedDataBuilder
java.lang.Object
eu.europa.esig.dss.cades.signature.CMSSignedDataBuilder
public class CMSSignedDataBuilder extends Object
-
Constructor Summary
Constructors Constructor Description CMSSignedDataBuilder(CertificateVerifier certificateVerifier)
This is the default constructor forCMSSignedDataGeneratorBuilder
. -
Method Summary
Modifier and Type Method Description 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).org.bouncycastle.cms.CMSSignedData
extendCMSSignedData(org.bouncycastle.cms.CMSSignedData cmsSignedData, ValidationDataForInclusion validationDataForInclusion, List<DSSDocument> detachedContents)
Extends the providedcmsSignedData
with the required validation dataprotected org.bouncycastle.cms.CMSSignedData
regenerateCMSSignedData(org.bouncycastle.cms.CMSSignedData cmsSignedData, List<DSSDocument> detachedContents, org.bouncycastle.util.Store certificatesStore, org.bouncycastle.util.Store attributeCertificatesStore, org.bouncycastle.util.Store crlsStore, org.bouncycastle.util.Store otherRevocationInfoFormatStoreBasic, org.bouncycastle.util.Store otherRevocationInfoFormatStoreOcsp)
-
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) throws DSSExceptionNote: 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
- Throws:
DSSException
-
regenerateCMSSignedData
protected org.bouncycastle.cms.CMSSignedData regenerateCMSSignedData(org.bouncycastle.cms.CMSSignedData cmsSignedData, List<DSSDocument> detachedContents, org.bouncycastle.util.Store certificatesStore, org.bouncycastle.util.Store attributeCertificatesStore, org.bouncycastle.util.Store crlsStore, org.bouncycastle.util.Store otherRevocationInfoFormatStoreBasic, org.bouncycastle.util.Store otherRevocationInfoFormatStoreOcsp) -
extendCMSSignedData
public org.bouncycastle.cms.CMSSignedData extendCMSSignedData(org.bouncycastle.cms.CMSSignedData cmsSignedData, ValidationDataForInclusion validationDataForInclusion, List<DSSDocument> detachedContents)Extends the providedcmsSignedData
with the required validation data- Parameters:
cmsSignedData
-CMSSignedData
to be extendedvalidationDataForInclusion
- theValidationDataForInclusion
to be included into the cmsSignedDatadetachedContents
- list of detachedDSSDocument
s- Returns:
- extended
CMSSignedData
-