Class PDFDocumentValidator

java.lang.Object
eu.europa.esig.dss.validation.SignedDocumentValidator
eu.europa.esig.dss.pades.validation.PDFDocumentValidator
All Implemented Interfaces:
eu.europa.esig.dss.validation.DocumentValidator, eu.europa.esig.dss.validation.ProcessExecutorProvider<eu.europa.esig.dss.validation.executor.DocumentProcessExecutor>

public class PDFDocumentValidator extends eu.europa.esig.dss.validation.SignedDocumentValidator
Validation of PDF document.
  • Field Summary

    Fields inherited from class eu.europa.esig.dss.validation.SignedDocumentValidator

    certificateVerifier, containerContents, detachedContents, detachedEvidenceRecordDocuments, document, manifestFile, processExecutor, signingCertificateSource, skipValidationContextExecution
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Empty constructor
     
    PDFDocumentValidator(eu.europa.esig.dss.model.DSSDocument document)
    The default constructor for PDFDocumentValidator.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken>
     
    protected List<eu.europa.esig.dss.validation.AdvancedSignature>
     
    protected List<eu.europa.esig.dss.validation.AdvancedSignature>
     
    List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken>
     
    Returns a list of found DSS Dictionaries across different revisions
    This method returns a list of DSS revisions
    List<eu.europa.esig.dss.model.DSSDocument>
    getOriginalDocuments(eu.europa.esig.dss.validation.AdvancedSignature advancedSignature)
     
    This method returns a PDF timestamp scope finder
    protected List<PdfRevision>
    Gets the list of PDF document revisions
    <T extends eu.europa.esig.dss.validation.AdvancedSignature>
    PdfValidationDataContainer
    getValidationData(Collection<T> signatures, Collection<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> detachedTimestamps)
     
     
     
    boolean
    isSupported(eu.europa.esig.dss.model.DSSDocument dssDocument)
     
    protected void
    postProcessing(List<eu.europa.esig.dss.validation.AdvancedSignature> signatures)
    Post-process the extracted signatures NOTE: the method shall be used only for the document validation
    protected void
    prepareDssDictionaryValidationContext(eu.europa.esig.dss.validation.ValidationContext validationContext, List<PdfDocDssRevision> dssRevisions)
    Fills the validateContext with certificate tokens from dssDicts
    protected <T extends eu.europa.esig.dss.validation.AdvancedSignature>
    eu.europa.esig.dss.validation.ValidationContext
    prepareValidationContext(Collection<T> signatures, Collection<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> detachedTimestamps, Collection<eu.europa.esig.dss.validation.evidencerecord.EvidenceRecord> detachedEvidenceRecords, eu.europa.esig.dss.validation.CertificateVerifier certificateVerifier)
     
    void
    setPasswordProtection(char[] passwordProtection)
    Specify the used password for the encrypted document
    void
    Set the IPdfObjFactory.
    protected void
    timestampPostProcessing(List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> timestampTokens)
    Post-process the extracted detached timestamps NOTE: the method shall be used only for the document validation

    Methods inherited from class eu.europa.esig.dss.validation.SignedDocumentValidator

    addReference, appendCounterSignatures, appendExternalEvidenceRecords, assertConfigurationValid, buildDetachedEvidenceRecords, buildEvidenceRecord, coversSignature, createDiagnosticDataBuilder, createDiagnosticDataBuilder, findSignatureScopes, fromDocument, getDefaultDigestAlgorithm, getDefaultProcessExecutor, getDetachedEvidenceRecords, getDiagnosticData, getEvidenceRecord, getEvidenceRecordScopes, getOriginalDocuments, getSignatureById, getSignaturePolicyProvider, getSignaturePolicyValidatorLoader, getSignatures, getTimestampedReferences, getTokenIdentifierProvider, getValidationData, getValidationTime, prepareDetachedEvidenceRecordValidationContext, prepareDetachedTimestampValidationContext, prepareDiagnosticDataBuilder, prepareSignatureForVerification, prepareSignatureValidationContext, prepareValidationContext, processSignaturesValidation, processValidationPolicy, provideProcessExecutorInstance, setCertificateVerifier, setContainerContents, setDetachedContents, setDetachedEvidenceRecordDocuments, setEnableEtsiValidationReport, setIncludeSemantics, setLocale, setManifestFile, setProcessExecutor, setSignaturePolicyProvider, setSigningCertificateSource, setSkipValidationContextExecution, setTokenExtractionStrategy, setTokenIdentifierProvider, setValidationLevel, setValidationTime, validateContext, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument

    Methods inherited from class java.lang.Object

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

    • PDFDocumentValidator

      protected PDFDocumentValidator()
      Empty constructor
    • PDFDocumentValidator

      public PDFDocumentValidator(eu.europa.esig.dss.model.DSSDocument document)
      The default constructor for PDFDocumentValidator.
      Parameters:
      document - DSSDocument
  • Method Details

    • isSupported

      public boolean isSupported(eu.europa.esig.dss.model.DSSDocument dssDocument)
      Specified by:
      isSupported in class eu.europa.esig.dss.validation.SignedDocumentValidator
    • 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.
    • setPasswordProtection

      public void setPasswordProtection(char[] passwordProtection)
      Specify the used password for the encrypted document
      Parameters:
      passwordProtection - the used password
    • prepareValidationContext

      protected <T extends eu.europa.esig.dss.validation.AdvancedSignature> eu.europa.esig.dss.validation.ValidationContext prepareValidationContext(Collection<T> signatures, Collection<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> detachedTimestamps, Collection<eu.europa.esig.dss.validation.evidencerecord.EvidenceRecord> detachedEvidenceRecords, eu.europa.esig.dss.validation.CertificateVerifier certificateVerifier)
      Overrides:
      prepareValidationContext in class eu.europa.esig.dss.validation.SignedDocumentValidator
    • initializeDiagnosticDataBuilder

      protected PAdESDiagnosticDataBuilder initializeDiagnosticDataBuilder()
      Overrides:
      initializeDiagnosticDataBuilder in class eu.europa.esig.dss.validation.SignedDocumentValidator
    • prepareDssDictionaryValidationContext

      protected void prepareDssDictionaryValidationContext(eu.europa.esig.dss.validation.ValidationContext validationContext, List<PdfDocDssRevision> dssRevisions)
      Fills the validateContext with certificate tokens from dssDicts
      Parameters:
      validationContext - ValidationContext to enrich
      dssRevisions - a list of PdfDocDssRevisions
    • getAllSignatures

      protected List<eu.europa.esig.dss.validation.AdvancedSignature> getAllSignatures()
      Overrides:
      getAllSignatures in class eu.europa.esig.dss.validation.SignedDocumentValidator
    • postProcessing

      protected void postProcessing(List<eu.europa.esig.dss.validation.AdvancedSignature> signatures)
      Post-process the extracted signatures NOTE: the method shall be used only for the document validation
      Parameters:
      signatures - a list of AdvancedSignatures
    • getDetachedTimestamps

      public List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> getDetachedTimestamps()
      Specified by:
      getDetachedTimestamps in interface eu.europa.esig.dss.validation.DocumentValidator
      Overrides:
      getDetachedTimestamps in class eu.europa.esig.dss.validation.SignedDocumentValidator
    • timestampPostProcessing

      protected void timestampPostProcessing(List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> timestampTokens)
      Post-process the extracted detached timestamps NOTE: the method shall be used only for the document validation
      Parameters:
      timestampTokens - a list of TimestampTokens
    • buildSignatures

      protected List<eu.europa.esig.dss.validation.AdvancedSignature> buildSignatures()
      Overrides:
      buildSignatures in class eu.europa.esig.dss.validation.SignedDocumentValidator
    • buildDetachedTimestamps

      protected List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> buildDetachedTimestamps()
      Overrides:
      buildDetachedTimestamps in class eu.europa.esig.dss.validation.SignedDocumentValidator
    • getPAdESTimestampScopeFinder

      protected PAdESTimestampScopeFinder getPAdESTimestampScopeFinder()
      This method returns a PDF timestamp scope finder
      Returns:
      PAdESTimestampScopeFinder
    • getDssDictionaries

      public List<PdfDssDict> getDssDictionaries()
      Returns a list of found DSS Dictionaries across different revisions
      Returns:
      list of PdfDssDicts
    • getDssRevisions

      protected List<PdfDocDssRevision> getDssRevisions()
      This method returns a list of DSS revisions
      Returns:
      a list of PdfDocDssRevisions
    • getRevisions

      protected List<PdfRevision> getRevisions()
      Gets the list of PDF document revisions
      Returns:
      a list of PdfRevisions
    • getValidationData

      public <T extends eu.europa.esig.dss.validation.AdvancedSignature> PdfValidationDataContainer getValidationData(Collection<T> signatures, Collection<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> detachedTimestamps)
      Specified by:
      getValidationData in interface eu.europa.esig.dss.validation.DocumentValidator
      Overrides:
      getValidationData in class eu.europa.esig.dss.validation.SignedDocumentValidator
    • instantiateValidationDataContainer

      protected PdfValidationDataContainer instantiateValidationDataContainer()
      Overrides:
      instantiateValidationDataContainer in class eu.europa.esig.dss.validation.SignedDocumentValidator
    • getOriginalDocuments

      public List<eu.europa.esig.dss.model.DSSDocument> getOriginalDocuments(eu.europa.esig.dss.validation.AdvancedSignature advancedSignature)