Class AbstractDocumentExtender<SP extends AbstractSignatureParameters<?>, TP extends eu.europa.esig.dss.model.TimestampParameters>

java.lang.Object
eu.europa.esig.dss.extension.SignedDocumentExtender
eu.europa.esig.dss.extension.AbstractDocumentExtender<SP,TP>
Type Parameters:
SP - SerializableSignatureParameters specifying the signature creation parameters
TP - SerializableTimestampParameters specifying the timestamp creation parameters, when applicable

public abstract class AbstractDocumentExtender<SP extends AbstractSignatureParameters<?>, TP extends eu.europa.esig.dss.model.TimestampParameters> extends SignedDocumentExtender
This class provides an abstract implementation of the eu.europa.esig.dss.spi.augmentation.DocumentExtender
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected eu.europa.esig.dss.model.DSSDocument
    The document to be augmented (with the signatures)

    Fields inherited from class SignedDocumentExtender

    certificateVerifier, services, tspSource
    Modifier and Type
    Field
    Description
    protected eu.europa.esig.dss.spi.validation.CertificateVerifier
    The reference to the certificate verifier.
    protected DocumentSignatureService<?,?>[]
    (Optional) Document signature services.
    protected eu.europa.esig.dss.spi.x509.tsp.TSPSource
    The source to be used for a timestamp token request, when applicable.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Empty constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract DocumentSignatureService<SP,TP>
    This method created a new instance of DocumentSignatureService
    protected abstract SP
    This method returns a new instance of empty signature parameters, according to the given format implementation
    eu.europa.esig.dss.model.DSSDocument
    extendDocument(eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile)
     
    eu.europa.esig.dss.model.DSSDocument
    extendDocument(eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile, eu.europa.esig.dss.model.SerializableSignatureParameters... extensionParameters)
     
    eu.europa.esig.dss.model.DSSDocument
    extendDocument(eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile, List<eu.europa.esig.dss.model.DSSDocument> detachedContents)
     
    eu.europa.esig.dss.model.DSSDocument
    extendDocument(eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile, List<eu.europa.esig.dss.model.DSSDocument> detachedContents, eu.europa.esig.dss.model.SerializableSignatureParameters... extensionParameters)
     
    protected SP
    fillSignatureParameters(SP signatureParameters, eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile, List<eu.europa.esig.dss.model.DSSDocument> detachedContents)
    This method fills the signatureParameters with the parameters from the augmentationParameters
    protected eu.europa.esig.dss.enumerations.SignatureLevel
    getSignatureLevel(eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile)
    Gets the target SignatureLevel for the given SignatureProfile relatively to the signature format
    protected SP
    initSignatureParameters(eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile, List<eu.europa.esig.dss.model.DSSDocument> detachedContents, eu.europa.esig.dss.model.SerializableSignatureParameters... extensionParameters)
    This method initializes signature parameters to be used on the signature augmentation
    This method initializes a new DocumentSignatureService
    boolean
    isSupported(eu.europa.esig.dss.model.DSSDocument arg0)
     
    protected abstract boolean
    isSupportedParameters(eu.europa.esig.dss.model.SerializableSignatureParameters parameters)
    This method verifies whether the provided signature parameters are supported by the current implementation
    protected abstract boolean
    This method verifies whether the provided document signature service is supported by the current implementation

    Methods inherited from class SignedDocumentExtender

    fromDocument, getSignatureForm, isASiC, setCertificateVerifier, setServices, setTspSource
    Modifier and Type
    Method
    Description
    fromDocument(eu.europa.esig.dss.model.DSSDocument dssDocument)
    This method guesses the document format and returns an appropriate document reader.
    abstract eu.europa.esig.dss.enumerations.SignatureForm
    Gets the signature form for the current implementation
    boolean
    Gets whether the document to be extended represents an ASiC container
    void
    setCertificateVerifier(eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier)
     
    void
    (Optional) Sets document signature services.
    void
    setTspSource(eu.europa.esig.dss.spi.x509.tsp.TSPSource tspSource)
     

    Methods inherited from class Object

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

    • document

      protected eu.europa.esig.dss.model.DSSDocument document
      The document to be augmented (with the signatures)
  • Constructor Details

    • AbstractDocumentExtender

      protected AbstractDocumentExtender()
      Empty constructor
  • Method Details

    • extendDocument

      public eu.europa.esig.dss.model.DSSDocument extendDocument(eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile)
    • extendDocument

      public eu.europa.esig.dss.model.DSSDocument extendDocument(eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile, List<eu.europa.esig.dss.model.DSSDocument> detachedContents)
    • extendDocument

      public eu.europa.esig.dss.model.DSSDocument extendDocument(eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile, eu.europa.esig.dss.model.SerializableSignatureParameters... extensionParameters)
    • extendDocument

      public eu.europa.esig.dss.model.DSSDocument extendDocument(eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile, List<eu.europa.esig.dss.model.DSSDocument> detachedContents, eu.europa.esig.dss.model.SerializableSignatureParameters... extensionParameters)
    • initSignatureService

      protected DocumentSignatureService<SP,TP> initSignatureService()
      This method initializes a new DocumentSignatureService
      Returns:
      DocumentSignatureService
    • createSignatureService

      protected abstract DocumentSignatureService<SP,TP> createSignatureService()
      This method created a new instance of DocumentSignatureService
      Returns:
      DocumentSignatureService
    • isSupportedService

      protected abstract boolean isSupportedService(DocumentSignatureService<?,?> service)
      This method verifies whether the provided document signature service is supported by the current implementation
      Parameters:
      service - DocumentSignatureService to check
      Returns:
      TRUE if the service is supported by the current implementation, FALSE otherwise
    • initSignatureParameters

      protected SP initSignatureParameters(eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile, List<eu.europa.esig.dss.model.DSSDocument> detachedContents, eu.europa.esig.dss.model.SerializableSignatureParameters... extensionParameters)
      This method initializes signature parameters to be used on the signature augmentation
      Parameters:
      signatureProfile - SignatureProfile representing a target level on signature augmentation
      detachedContents - a list of DSSDocument for a detached signature
      extensionParameters - array of format specific SerializableSignatureParameters, when applicable
      Returns:
      SerializableSignatureParameters
    • emptySignatureParameters

      protected abstract SP emptySignatureParameters()
      This method returns a new instance of empty signature parameters, according to the given format implementation
      Returns:
      SerializableSignatureParameters
    • isSupportedParameters

      protected abstract boolean isSupportedParameters(eu.europa.esig.dss.model.SerializableSignatureParameters parameters)
      This method verifies whether the provided signature parameters are supported by the current implementation
      Parameters:
      parameters - SerializableSignatureParameters to check
      Returns:
      TRUE if the parameters are supported by the current implementation, FALSE otherwise
    • fillSignatureParameters

      protected SP fillSignatureParameters(SP signatureParameters, eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile, List<eu.europa.esig.dss.model.DSSDocument> detachedContents)
      This method fills the signatureParameters with the parameters from the augmentationParameters
      Parameters:
      signatureParameters - SerializableSignatureParameters to fill
      signatureProfile - SignatureProfile representing a target level on signature augmentation
      detachedContents - a list of DSSDocument for a detached signature
      Returns:
      SerializableSignatureParameters
    • getSignatureLevel

      protected eu.europa.esig.dss.enumerations.SignatureLevel getSignatureLevel(eu.europa.esig.dss.enumerations.SignatureProfile signatureProfile)
      Gets the target SignatureLevel for the given SignatureProfile relatively to the signature format
      Parameters:
      signatureProfile - SignatureProfile
      Returns:
      SignatureLevel
    • isSupported

      boolean isSupported(eu.europa.esig.dss.model.DSSDocument arg0)