Class CMSSignedDataBuilder

java.lang.Object
eu.europa.esig.dss.cades.signature.CMSSignedDataBuilder

public class CMSSignedDataBuilder extends Object
Builds a CMSSignedData
  • Constructor Summary

    Constructors
    Constructor
    Description
    This is the default constructor for CMSSignedDataGeneratorBuilder.
  • 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, ValidationData validationDataForInclusion)
    Extends the provided cmsSignedData with the required validation data

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CMSSignedDataBuilder

      public CMSSignedDataBuilder(CertificateVerifier certificateVerifier)
      This is the default constructor for CMSSignedDataGeneratorBuilder. The CertificateVerifier 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 parameters
      contentSigner - the contentSigner to get the hash of the data to be signed
      signerInfoGeneratorBuilder - the builder for the signer info generator
      originalSignedData - 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 provided cmsSignedData with the required validation data
      Parameters:
      cmsSignedData - CMSSignedData to be extended
      validationDataForInclusion - the ValidationData to be included into the cmsSignedData
      Returns:
      extended CMSSignedData