Interface DocumentSignatureService<SP extends eu.europa.esig.dss.model.SerializableSignatureParameters,TP extends eu.europa.esig.dss.model.SerializableTimestampParameters>

Type Parameters:
SP - implementation of signature parameters corresponding to the supported signature format
TP - implementation of timestamp parameters corresponding to the supported document format
All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractSignatureService

public interface DocumentSignatureService<SP extends eu.europa.esig.dss.model.SerializableSignatureParameters,TP extends eu.europa.esig.dss.model.SerializableTimestampParameters> extends Serializable
This interface DocumentSignatureService provides operations for the signature creation and for its extension.
  • Method Summary

    Modifier and Type
    Method
    Description
    eu.europa.esig.dss.model.DSSDocument
    extendDocument(eu.europa.esig.dss.model.DSSDocument toExtendDocument, SP parameters)
    Extends the level of the signatures in the toExtendDocument
    eu.europa.esig.dss.spi.x509.tsp.TimestampToken
    getContentTimestamp(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters)
    This method allows to compute a content-timestamp (which is added in the signed properties)
    eu.europa.esig.dss.model.ToBeSigned
    getDataToSign(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters)
    Retrieves the bytes of the data that need to be signed based on the toSignDocument and parameters.
    boolean
    isValidSignatureValue(eu.europa.esig.dss.model.ToBeSigned toBeSigned, eu.europa.esig.dss.model.SignatureValue signatureValue, eu.europa.esig.dss.model.x509.CertificateToken signingCertificate)
    Verifies the signature value against a ToBeSigned and a CertificateToken
    void
    setTspSource(eu.europa.esig.dss.spi.x509.tsp.TSPSource tspSource)
    This setter allows to define the TSP (timestamp provider) source.
    eu.europa.esig.dss.model.DSSDocument
    signDocument(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters, eu.europa.esig.dss.model.SignatureValue signatureValue)
    Signs the toSignDocument with the provided signatureValue.
    eu.europa.esig.dss.model.DSSDocument
    timestamp(eu.europa.esig.dss.model.DSSDocument toTimestampDocument, TP parameters)
    This method allows to add a timestamp to an unsigned document
  • Method Details

    • getDataToSign

      eu.europa.esig.dss.model.ToBeSigned getDataToSign(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters)
      Retrieves the bytes of the data that need to be signed based on the toSignDocument and parameters. When toSignDocument contains an already existing signature the returned bytes are related to a new parallel signature. - Enveloped signature (XML): a new signature is added and the signed data corresponds to that pointed by the first signature; - Enveloping signature: - - XML: The parallel signature is not possible - - CMS: A new parallel signature is added - Detached signature: - - XML: The parallel signature is added - - CMS: A new parallel signature is added
      Parameters:
      toSignDocument - document to sign or the already existing signature
      parameters - set of the driving signing parameters
      Returns:
      the data to be signed
    • isValidSignatureValue

      boolean isValidSignatureValue(eu.europa.esig.dss.model.ToBeSigned toBeSigned, eu.europa.esig.dss.model.SignatureValue signatureValue, eu.europa.esig.dss.model.x509.CertificateToken signingCertificate)
      Verifies the signature value against a ToBeSigned and a CertificateToken
      Parameters:
      toBeSigned - the signed data
      signatureValue - the signature value
      signingCertificate - the used certificate to create the signature value
      Returns:
      true if the signature value is valid
    • signDocument

      eu.europa.esig.dss.model.DSSDocument signDocument(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters, eu.europa.esig.dss.model.SignatureValue signatureValue)
      Signs the toSignDocument with the provided signatureValue.
      Parameters:
      toSignDocument - document to sign
      parameters - set of the driving signing parameters
      signatureValue - the signature value to incorporate
      Returns:
      the signed document (toSignDocument with the incorporated signature or the detached signature)
    • extendDocument

      eu.europa.esig.dss.model.DSSDocument extendDocument(eu.europa.esig.dss.model.DSSDocument toExtendDocument, SP parameters)
      Extends the level of the signatures in the toExtendDocument
      Parameters:
      toExtendDocument - document to extend
      parameters - set of the driving signing parameters
      Returns:
      the extended signature
    • setTspSource

      void setTspSource(eu.europa.esig.dss.spi.x509.tsp.TSPSource tspSource)
      This setter allows to define the TSP (timestamp provider) source.
      Parameters:
      tspSource - The time stamp source which is used when timestamping the signature.
    • getContentTimestamp

      eu.europa.esig.dss.spi.x509.tsp.TimestampToken getContentTimestamp(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters)
      This method allows to compute a content-timestamp (which is added in the signed properties)
      Parameters:
      toSignDocument - document to sign or the already existing signature
      parameters - set of the driving signing parameters
      Returns:
      a timestamp token
    • timestamp

      eu.europa.esig.dss.model.DSSDocument timestamp(eu.europa.esig.dss.model.DSSDocument toTimestampDocument, TP parameters)
      This method allows to add a timestamp to an unsigned document
      Parameters:
      toTimestampDocument - the document to be timestamped
      parameters - set of the driving timestamping parameters
      Returns:
      the timestamped document