Interface DocumentExtender

All Known Implementing Classes:
AbstractDocumentExtender, ASiCWithCAdESDocumentExtender, ASiCWithXAdESDocumentExtender, CAdESDocumentExtender, JAdESDocumentExtender, PAdESDocumentExtender, SignedDocumentExtender, XAdESDocumentExtender

public interface DocumentExtender
This class performs a signature augmentation to the specified target augmentation level, respectively to the signature's format, which is determined in the runtime during the method execution.

This class can be used as an alternative to the eu.europa.esig.dss.signature.DocumentSignatureService#extendDocument which requires the client to know the original signature format before the method execution.

  • Method Details

    • setCertificateVerifier

      void setCertificateVerifier(CertificateVerifier certificateVerifier)
      Sets a CertificateVerifier providing a configuration for validation of certificates within the original signature or signatures.
      Parameters:
      certificateVerifier - CertificateVerifier
    • setTspSource

      void setTspSource(TSPSource tspSource)
      Source to be used for time-stamp requests, when applicable (e.g. BASELINE-T or BASELINE-LTA profile extension)
      Parameters:
      tspSource - TSPSource
    • isSupported

      boolean isSupported(DSSDocument dssDocument)
      Checks if the document is supported by the current signature extender
      Parameters:
      dssDocument - DSSDocument to check
      Returns:
      TRUE if the document is supported, FALSE otherwise
    • extendDocument

      DSSDocument extendDocument(SignatureProfile signatureProfile)
      Performs augmentation of all signatures within the provided document according to the specified target signatureProfile.
      Parameters:
      signatureProfile - SignatureProfile identifying the desired target augmentation level
      Returns:
      DSSDocument containing the augmented signatures, if the augmentation succeeds.
    • extendDocument

      DSSDocument extendDocument(SignatureProfile signatureProfile, List<DSSDocument> detachedContents)
      Performs augmentation of all signatures of a detached format within the provided document according to the specified target signatureProfile.
      Parameters:
      signatureProfile - SignatureProfile identifying the desired target augmentation level
      detachedContents - list of DSSDocuments representing a signed content in case of a detached signature
      Returns:
      DSSDocument containing the augmented signatures, if the augmentation succeeds.
    • extendDocument

      DSSDocument extendDocument(SignatureProfile signatureProfile, SerializableSignatureParameters... extensionParameters)
      Performs augmentation of all signatures within the provided document according to the specified augmentationParameters, with format specific extensionParameters.

      If explicitParameters are provided, and they contain an implementation of parameters matching the current signature format, those signature parameters will be used explicitly on this signature augmentation. This can be useful when a signature augmentation process for a certain signature format should take into account particular signature constraints (i.e. /Contents size for a PAdES document time-stamp, etc.).

      NOTE 1: If the matching implementation of extension parameters found, and it contains signatureLevel and/or detachedContents definition, the existing values will be used. Otherwise, the content of the extension parameters will be overwritten respectively. NOTE 2: The definition of extension parameters is order dependent. The first parameters matching the signature format implementation will be used.

      Parameters:
      signatureProfile - SignatureProfile identifying the desired target augmentation level
      extensionParameters - (optional) SerializableSignatureParameters containing format specific requirements
      Returns:
      DSSDocument containing the augmented signatures, if the augmentation succeeds.
    • extendDocument

      DSSDocument extendDocument(SignatureProfile signatureProfile, List<DSSDocument> detachedContents, SerializableSignatureParameters... extensionParameters)
      Performs augmentation of all signatures of a detached format within the provided document according to the specified target signatureProfile, with format specific extensionParameters.

      If explicitParameters are provided, and they contain an implementation of parameters matching the current signature format, those signature parameters will be used explicitly on this signature augmentation. This can be useful when a signature augmentation process for a certain signature format should take into account particular signature constraints (i.e. /Contents size for a PAdES document time-stamp, etc.).

      NOTE 1: If the matching implementation of extension parameters found, and it contains signatureLevel and/or detachedContents definition, the existing values will be used. Otherwise, the content of the extension parameters will be overwritten respectively. NOTE 2: The definition of extension parameters is order dependent. The first parameters matching the signature format implementation will be used.

      Parameters:
      signatureProfile - SignatureProfile identifying the desired target augmentation level
      detachedContents - list of DSSDocuments representing a signed content in case of a detached signature
      extensionParameters - (optional) SerializableSignatureParameters containing format specific requirements
      Returns:
      DSSDocument containing the augmented signatures, if the augmentation succeeds.