Class CAdESCounterSignatureBuilder

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

public class CAdESCounterSignatureBuilder extends Object
The class to build a CAdES counter signature
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder
    This object is used to create data container objects such as an OutputStream or a DSSDocument
  • Constructor Summary

    Constructors
    Constructor
    Description
    CAdESCounterSignatureBuilder(eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier)
    The default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    eu.europa.esig.dss.model.DSSDocument
    addCounterSignature(eu.europa.esig.dss.cms.CMS originalCMS, CAdESCounterSignatureParameters parameters, eu.europa.esig.dss.model.SignatureValue signatureValue)
    Adds a counter signature the provided CMS
    org.bouncycastle.cms.SignerInformationStore
    generateCounterSignature(org.bouncycastle.cms.SignerInformation signerInformation, CAdESSignatureParameters parameters, eu.europa.esig.dss.cms.operator.CustomContentSigner customContentSigner)
    Generates a counter-signature SignerInformationStore
    org.bouncycastle.cms.SignerInformation
    getSignerInformationToBeCounterSigned(eu.europa.esig.dss.model.DSSDocument signatureDocument, CAdESCounterSignatureParameters parameters)
    Returns a SignerInformation to be counter-signed
    initCMSBuilderHelper(eu.europa.esig.dss.model.DSSDocument contentToSign, CAdESSignatureParameters signatureParameters, org.bouncycastle.operator.ContentSigner contentSigner)
    Instantiates a CMSForCAdESBuilderHelper
    void
    setManifestFile(eu.europa.esig.dss.model.ManifestFile manifestFile)
    Sets a signed manifest file NOTE: ASiC only
    void
    setResourcesHandlerBuilder(eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder resourcesHandlerBuilder)
    This method sets a DSSResourcesHandlerBuilder to be used for operating with internal objects during the signature creation procedure.

    Methods inherited from class Object

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

    • resourcesHandlerBuilder

      protected eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder resourcesHandlerBuilder
      This object is used to create data container objects such as an OutputStream or a DSSDocument
  • Constructor Details

    • CAdESCounterSignatureBuilder

      public CAdESCounterSignatureBuilder(eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier)
      The default constructor
      Parameters:
      certificateVerifier - CertificateVerifier
  • Method Details

    • setManifestFile

      public void setManifestFile(eu.europa.esig.dss.model.ManifestFile manifestFile)
      Sets a signed manifest file NOTE: ASiC only
      Parameters:
      manifestFile - ManifestFile
    • setResourcesHandlerBuilder

      public void setResourcesHandlerBuilder(eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder resourcesHandlerBuilder)
      This method sets a DSSResourcesHandlerBuilder to be used for operating with internal objects during the signature creation procedure.
      Parameters:
      resourcesHandlerBuilder - DSSResourcesHandlerBuilder
    • addCounterSignature

      public eu.europa.esig.dss.model.DSSDocument addCounterSignature(eu.europa.esig.dss.cms.CMS originalCMS, CAdESCounterSignatureParameters parameters, eu.europa.esig.dss.model.SignatureValue signatureValue)
      Adds a counter signature the provided CMS
      Parameters:
      originalCMS - CMS to add a counter signature into
      parameters - CAdESCounterSignatureParameters
      signatureValue - SignatureValue
      Returns:
      DSSDocument with an added counter signature
    • generateCounterSignature

      public org.bouncycastle.cms.SignerInformationStore generateCounterSignature(org.bouncycastle.cms.SignerInformation signerInformation, CAdESSignatureParameters parameters, eu.europa.esig.dss.cms.operator.CustomContentSigner customContentSigner)
      Generates a counter-signature SignerInformationStore
      Parameters:
      signerInformation - SignerInformation of a signature to be counter-signed
      parameters - CAdESCounterSignatureParameters
      customContentSigner - CustomContentSigner
      Returns:
      SignerInformationStore
    • getSignerInformationToBeCounterSigned

      public org.bouncycastle.cms.SignerInformation getSignerInformationToBeCounterSigned(eu.europa.esig.dss.model.DSSDocument signatureDocument, CAdESCounterSignatureParameters parameters)
      Returns a SignerInformation to be counter-signed
      Parameters:
      signatureDocument - DSSDocument to find the related signature
      parameters - CAdESCounterSignatureParameters
      Returns:
      SignerInformation
    • initCMSBuilderHelper

      protected CMSForCAdESBuilderHelper initCMSBuilderHelper(eu.europa.esig.dss.model.DSSDocument contentToSign, CAdESSignatureParameters signatureParameters, org.bouncycastle.operator.ContentSigner contentSigner)
      Instantiates a CMSForCAdESBuilderHelper
      Parameters:
      contentToSign - DSSDocument
      signatureParameters - CAdESSignatureParameters
      contentSigner - ContentSigner
      Returns:
      CMSForCAdESBuilderHelper