Interface PDFSignatureService

All Known Implementing Classes:
AbstractPDFSignatureService

public interface PDFSignatureService
The usage of this interface permits the user to choose the underlying PDF library used to create PDF signatures.
  • Method Summary

    Modifier and Type Method Description
    eu.europa.esig.dss.model.DSSDocument addDssDictionary​(eu.europa.esig.dss.model.DSSDocument document, List<DSSDictionaryCallback> callbacks)
    This method adds the DSS dictionary (Baseline-LT)
    eu.europa.esig.dss.model.DSSDocument addNewSignatureField​(eu.europa.esig.dss.model.DSSDocument document, SignatureFieldParameters parameters)
    This method allows to add a new signature field to an existing pdf document
    byte[] digest​(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters, eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm)
    Returns the digest value of a PDF document
    List<String> getAvailableSignatureFields​(eu.europa.esig.dss.model.DSSDocument document)
    This method returns not signed signature-fields
    eu.europa.esig.dss.model.DSSDocument sign​(eu.europa.esig.dss.model.DSSDocument pdfData, byte[] signatureValue, PAdESSignatureParameters parameters, eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm)
    Signs a PDF document
    void validateSignatures​(eu.europa.esig.dss.spi.x509.CertificatePool validationCertPool, eu.europa.esig.dss.model.DSSDocument document, SignatureValidationCallback callback)
    Retrieves and triggers validation of the signatures from a PDF document
  • Method Details

    • digest

      byte[] digest​(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters, eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm)
      Returns the digest value of a PDF document
      Parameters:
      toSignDocument - the document to be signed
      parameters - the signature parameters
      digestAlgorithm - the digest algorithm to be used
      Returns:
      the digest value
      Throws:
      eu.europa.esig.dss.model.DSSException - if an error occurred
    • sign

      eu.europa.esig.dss.model.DSSDocument sign​(eu.europa.esig.dss.model.DSSDocument pdfData, byte[] signatureValue, PAdESSignatureParameters parameters, eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm)
      Signs a PDF document
      Parameters:
      pdfData - the pdf document
      signatureValue - the signature value
      parameters - the signature parameters
      digestAlgorithm - the digest algorithm to be used
      Throws:
      eu.europa.esig.dss.model.DSSException - if an error occurred
    • validateSignatures

      void validateSignatures​(eu.europa.esig.dss.spi.x509.CertificatePool validationCertPool, eu.europa.esig.dss.model.DSSDocument document, SignatureValidationCallback callback)
      Retrieves and triggers validation of the signatures from a PDF document
      Parameters:
      validationCertPool - the certificate pool
      document - the document to be validated
      callback - callback for signature validation
      Throws:
      eu.europa.esig.dss.model.DSSException - if an error occurred
    • addDssDictionary

      eu.europa.esig.dss.model.DSSDocument addDssDictionary​(eu.europa.esig.dss.model.DSSDocument document, List<DSSDictionaryCallback> callbacks)
      This method adds the DSS dictionary (Baseline-LT)
      Parameters:
      document - the document to be extended
      callbacks - the callbacks to retrieve the revocation data,...
      Returns:
      the pdf document with the added dss dictionary
      Throws:
      eu.europa.esig.dss.model.DSSException - if an error occurred
    • getAvailableSignatureFields

      List<String> getAvailableSignatureFields​(eu.europa.esig.dss.model.DSSDocument document)
      This method returns not signed signature-fields
      Parameters:
      document - the pdf document
      Returns:
      the list of empty signature fields
    • addNewSignatureField

      eu.europa.esig.dss.model.DSSDocument addNewSignatureField​(eu.europa.esig.dss.model.DSSDocument document, SignatureFieldParameters parameters)
      This method allows to add a new signature field to an existing pdf document
      Parameters:
      document - the pdf document
      parameters - the parameters with the coordinates,... of the signature field
      Returns:
      the pdf document with the new added signature field