Class PAdESService

java.lang.Object
eu.europa.esig.dss.signature.AbstractSignatureService<PAdESSignatureParameters,PAdESTimestampParameters>
eu.europa.esig.dss.pades.signature.PAdESService
All Implemented Interfaces:
eu.europa.esig.dss.signature.DocumentSignatureService<PAdESSignatureParameters,PAdESTimestampParameters>, Serializable

public class PAdESService extends eu.europa.esig.dss.signature.AbstractSignatureService<PAdESSignatureParameters,PAdESTimestampParameters>
PAdES implementation of the DocumentSignatureService
See Also:
  • Constructor Details

    • PAdESService

      public PAdESService(eu.europa.esig.dss.validation.CertificateVerifier certificateVerifier)
      This is the constructor to create an instance of the PAdESService. A certificate verifier must be provided.
      Parameters:
      certificateVerifier - CertificateVerifier provides information on the sources to be used in the validation process in the context of a signature.
  • Method Details

    • setPdfObjFactory

      public void setPdfObjFactory(IPdfObjFactory pdfObjFactory)
      Set the IPdfObjFactory. Allow to set the used implementation. Cannot be null.
      Parameters:
      pdfObjFactory - the implementation to be used.
    • setTspSource

      public void setTspSource(eu.europa.esig.dss.spi.x509.tsp.TSPSource tspSource)
      Specified by:
      setTspSource in interface eu.europa.esig.dss.signature.DocumentSignatureService<PAdESSignatureParameters,PAdESTimestampParameters>
      Overrides:
      setTspSource in class eu.europa.esig.dss.signature.AbstractSignatureService<PAdESSignatureParameters,PAdESTimestampParameters>
    • getContentTimestamp

      public eu.europa.esig.dss.spi.x509.tsp.TimestampToken getContentTimestamp(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters)
    • previewPageWithVisualSignature

      public eu.europa.esig.dss.model.DSSDocument previewPageWithVisualSignature(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters)
      Returns a page preview with the visual signature
      Parameters:
      toSignDocument - the document to be signed
      parameters - the signature/timestamp parameters
      Returns:
      a DSSDocument with the PNG picture
    • previewSignatureField

      public eu.europa.esig.dss.model.DSSDocument previewSignatureField(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters)
      Returns a preview of the signature field
      Parameters:
      toSignDocument - the document to be signed
      parameters - the signature/timestamp parameters
      Returns:
      a DSSDocument with the PNG picture
    • getDataToSign

      public eu.europa.esig.dss.model.ToBeSigned getDataToSign(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters) throws eu.europa.esig.dss.model.DSSException
      Throws:
      eu.europa.esig.dss.model.DSSException
    • computeDocumentDigest

      protected eu.europa.esig.dss.model.DSSMessageDigest computeDocumentDigest(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters)
      Computes digest of the document to be signed
      Parameters:
      toSignDocument - DSSDocument the to be signed PDF
      parameters - PAdESSignatureParameters
      Returns:
      DSSMessageDigest
    • signDocument

      public eu.europa.esig.dss.model.DSSDocument signDocument(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters, eu.europa.esig.dss.model.SignatureValue signatureValue)
    • generateCMSSignedData

      protected byte[] generateCMSSignedData(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters, eu.europa.esig.dss.model.SignatureValue signatureValue)
      Generates the CMSSignedData
      Parameters:
      toSignDocument - DSSDocument to be signed
      parameters - PAdESSignatureParameters
      signatureValue - SignatureValue
      Returns:
      byte array representing the CMSSignedData
    • extendDocument

      public eu.europa.esig.dss.model.DSSDocument extendDocument(eu.europa.esig.dss.model.DSSDocument toExtendDocument, PAdESSignatureParameters parameters) throws eu.europa.esig.dss.model.DSSException
      Throws:
      eu.europa.esig.dss.model.DSSException
    • getAvailableSignatureFields

      public 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
    • getAvailableSignatureFields

      public List<String> getAvailableSignatureFields(eu.europa.esig.dss.model.DSSDocument document, char[] passwordProtection)
      This method returns not signed signature-fields from an encrypted document
      Parameters:
      document - the pdf document
      passwordProtection - the password protection used to create the encrypted document
      Returns:
      the list of empty signature fields
    • addNewSignatureField

      public 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
    • addNewSignatureField

      public eu.europa.esig.dss.model.DSSDocument addNewSignatureField(eu.europa.esig.dss.model.DSSDocument document, SignatureFieldParameters parameters, char[] passwordProtection)
      This method allows to add a new signature field to an encrypted pdf document
      Parameters:
      document - the pdf document
      parameters - the parameters with the coordinates,... of the signature field
      passwordProtection - the password protection used to create the encrypted document
      Returns:
      the pdf document with the new added signature field
    • timestamp

      public eu.europa.esig.dss.model.DSSDocument timestamp(eu.europa.esig.dss.model.DSSDocument toTimestampDocument, PAdESTimestampParameters parameters)
      Specified by:
      timestamp in interface eu.europa.esig.dss.signature.DocumentSignatureService<PAdESSignatureParameters,PAdESTimestampParameters>
      Overrides:
      timestamp in class eu.europa.esig.dss.signature.AbstractSignatureService<PAdESSignatureParameters,PAdESTimestampParameters>
    • getPAdESSignatureService

      protected PDFSignatureService getPAdESSignatureService()
      This method is used to return a new PDFSignatureService for a signature creation
      Returns:
      PDFSignatureService
    • getContentTimestampService

      protected PDFSignatureService getContentTimestampService()
      This method is used to return a new PDFSignatureService for a content timestamp creation
      Returns:
      PDFSignatureService
    • getSignatureTimestampService

      protected PDFSignatureService getSignatureTimestampService()
      This method is used to return a new PDFSignatureService for a timestamp creation
      Returns:
      PDFSignatureService