Class PDFDocumentValidator
java.lang.Object
eu.europa.esig.dss.validation.SignedDocumentValidator
eu.europa.esig.dss.pades.validation.PDFDocumentValidator
- All Implemented Interfaces:
DocumentValidator
,ProcessExecutorProvider<DocumentProcessExecutor>
- Direct Known Subclasses:
PDFADocumentValidator
Validation of PDF document.
-
Field Summary
Fields inherited from class eu.europa.esig.dss.validation.SignedDocumentValidator
certificateVerifier, containerContents, detachedContents, document, manifestFile, processExecutor, signatureScopeFinder, signingCertificateSource, skipValidationContextExecution
-
Constructor Summary
ModifierConstructorDescriptionprotected
Empty constructorPDFDocumentValidator
(DSSDocument document) The default constructor for PDFDocumentValidator. -
Method Summary
Modifier and TypeMethodDescriptionprotected List<TimestampToken>
Builds a list of detachedTimestampToken
s extracted from the documentprotected List<AdvancedSignature>
This method build a list of signatures to be extracted from a document<T extends AdvancedSignature>
voidfindSignatureScopes
(Collection<T> allSignatures) Finds and assigns SignatureScopes for a list of signaturesprotected List<AdvancedSignature>
Returns a list of all signatures from the validating documentRetrieves the detached timestamps found in the documentReturns a list of found DSS Dictionaries across different revisionsprotected List<PdfDocDssRevision>
This method returns a list of DSS revisionsgetOriginalDocuments
(AdvancedSignature advancedSignature) This method returns the signed document(s) without their signature(s)protected PAdESTimestampScopeFinder
This method returns a PDF timestamp scope finderprotected List<PdfRevision>
Gets the list of PDF document revisions<T extends AdvancedSignature>
PdfValidationDataContainergetValidationData
(Collection<T> signatures, Collection<TimestampToken> detachedTimestamps) Extracts a validation data for provided collection of signatures and/or timestampsprotected PAdESDiagnosticDataBuilder
Initializes a relevantDiagnosticDataBuilder
for the given implementationprotected PdfValidationDataContainer
Creates a new instance ofValidationDataContainer
boolean
isSupported
(DSSDocument dssDocument) Checks if the document is supported by the current validatorprotected void
postProcessing
(List<AdvancedSignature> signatures) Post-process the extracted signatures NOTE: the method shall be used only for the document validationprotected void
prepareDssDictionaryValidationContext
(ValidationContext validationContext, List<PdfDocDssRevision> dssRevisions) Fills thevalidateContext
with certificate tokens fromdssDicts
protected <T extends AdvancedSignature>
ValidationContextprepareValidationContext
(Collection<T> signatures, Collection<TimestampToken> detachedTimestamps, CertificateVerifier certificateVerifier) Initializes and fillsValidationContext
with necessary data sourcesvoid
setPasswordProtection
(char[] passwordProtection) Specify the used password for the encrypted documentvoid
Deprecated.since DSS 5.12.void
setPdfObjFactory
(IPdfObjFactory pdfObjFactory) Set the IPdfObjFactory.protected void
timestampPostProcessing
(List<TimestampToken> timestampTokens) Post-process the extracted detached timestamps NOTE: the method shall be used only for the document validationMethods inherited from class eu.europa.esig.dss.validation.SignedDocumentValidator
addReference, appendCounterSignatures, assertConfigurationValid, createDiagnosticDataBuilder, findTimestampScopes, fromDocument, getDefaultDigestAlgorithm, getDefaultProcessExecutor, getDiagnosticData, getOriginalDocuments, getSignatureById, getSignaturePolicyProvider, getSignaturePolicyValidatorLoader, getSignatures, getTimestampedReferences, getTimestampScopeFinder, getTokenIdentifierProvider, getValidationData, getValidationTime, prepareDetachedTimestampValidationContext, prepareDiagnosticDataBuilder, prepareSignatureForVerification, prepareSignatureScopeFinder, prepareSignatureValidationContext, prepareTimestampScopeFinder, processSignaturesValidation, processValidationPolicy, provideProcessExecutorInstance, setCertificateVerifier, setContainerContents, setDetachedContents, setEnableEtsiValidationReport, setIncludeSemantics, setLocale, setManifestFile, setProcessExecutor, setSignaturePolicyProvider, setSigningCertificateSource, setSkipValidationContextExecution, setTokenExtractionStrategy, setTokenIdentifierProvider, setValidationLevel, setValidationTime, validateContext, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument
-
Constructor Details
-
PDFDocumentValidator
protected PDFDocumentValidator()Empty constructor -
PDFDocumentValidator
The default constructor for PDFDocumentValidator.- Parameters:
document
-DSSDocument
-
-
Method Details
-
isSupported
Description copied from class:SignedDocumentValidator
Checks if the document is supported by the current validator- Specified by:
isSupported
in classSignedDocumentValidator
- Parameters:
dssDocument
-DSSDocument
to check- Returns:
- TRUE if the document is supported, FALSE otherwise
-
setPdfObjFactory
Set the IPdfObjFactory. Allow to set the used implementation. Cannot be null.- Parameters:
pdfObjFactory
- the implementation to be used.
-
setPasswordProtection
Deprecated.since DSS 5.12. Use#setPasswordBinaries(pwd.toCharArray())
Specify the used password for the encrypted document- Parameters:
pwd
- the used password
-
setPasswordProtection
public void setPasswordProtection(char[] passwordProtection) Specify the used password for the encrypted document- Parameters:
passwordProtection
- the used password
-
prepareValidationContext
protected <T extends AdvancedSignature> ValidationContext prepareValidationContext(Collection<T> signatures, Collection<TimestampToken> detachedTimestamps, CertificateVerifier certificateVerifier) Description copied from class:SignedDocumentValidator
Initializes and fillsValidationContext
with necessary data sources- Overrides:
prepareValidationContext
in classSignedDocumentValidator
- Type Parameters:
T
-AdvancedSignature
implementation- Parameters:
signatures
- a collection ofAdvancedSignature
sdetachedTimestamps
- a collection of detachedTimestampToken
scertificateVerifier
-CertificateVerifier
to be used for the validation- Returns:
ValidationContext
-
initializeDiagnosticDataBuilder
Description copied from class:SignedDocumentValidator
Initializes a relevantDiagnosticDataBuilder
for the given implementation- Overrides:
initializeDiagnosticDataBuilder
in classSignedDocumentValidator
- Returns:
SignedDocumentDiagnosticDataBuilder
-
prepareDssDictionaryValidationContext
protected void prepareDssDictionaryValidationContext(ValidationContext validationContext, List<PdfDocDssRevision> dssRevisions) Fills thevalidateContext
with certificate tokens fromdssDicts
- Parameters:
validationContext
-ValidationContext
to enrichdssRevisions
- a list ofPdfDocDssRevision
s
-
getAllSignatures
Description copied from class:SignedDocumentValidator
Returns a list of all signatures from the validating document- Overrides:
getAllSignatures
in classSignedDocumentValidator
- Returns:
- a list of
AdvancedSignature
s
-
postProcessing
Post-process the extracted signatures NOTE: the method shall be used only for the document validation- Parameters:
signatures
- a list ofAdvancedSignature
s
-
getDetachedTimestamps
Description copied from interface:DocumentValidator
Retrieves the detached timestamps found in the document- Specified by:
getDetachedTimestamps
in interfaceDocumentValidator
- Overrides:
getDetachedTimestamps
in classSignedDocumentValidator
- Returns:
- a list of TimestampToken for validation purposes
-
timestampPostProcessing
Post-process the extracted detached timestamps NOTE: the method shall be used only for the document validation- Parameters:
timestampTokens
- a list ofTimestampToken
s
-
buildSignatures
Description copied from class:SignedDocumentValidator
This method build a list of signatures to be extracted from a document- Overrides:
buildSignatures
in classSignedDocumentValidator
- Returns:
- a list of
AdvancedSignature
s
-
buildDetachedTimestamps
Description copied from class:SignedDocumentValidator
Builds a list of detachedTimestampToken
s extracted from the document- Overrides:
buildDetachedTimestamps
in classSignedDocumentValidator
- Returns:
- a list of
TimestampToken
s
-
findSignatureScopes
Description copied from class:SignedDocumentValidator
Finds and assigns SignatureScopes for a list of signatures- Specified by:
findSignatureScopes
in interfaceDocumentValidator
- Overrides:
findSignatureScopes
in classSignedDocumentValidator
- Type Parameters:
T
-AdvancedSignature
implementation- Parameters:
allSignatures
- a list ofAdvancedSignature
s to get a SignatureScope list
-
getPAdESTimestampScopeFinder
This method returns a PDF timestamp scope finder- Returns:
PAdESTimestampScopeFinder
-
getDssDictionaries
Returns a list of found DSS Dictionaries across different revisions- Returns:
- list of
PdfDssDict
s
-
getDssRevisions
This method returns a list of DSS revisions- Returns:
- a list of
PdfDocDssRevision
s
-
getRevisions
Gets the list of PDF document revisions- Returns:
- a list of
PdfRevision
s
-
getValidationData
public <T extends AdvancedSignature> PdfValidationDataContainer getValidationData(Collection<T> signatures, Collection<TimestampToken> detachedTimestamps) Description copied from interface:DocumentValidator
Extracts a validation data for provided collection of signatures and/or timestamps- Specified by:
getValidationData
in interfaceDocumentValidator
- Overrides:
getValidationData
in classSignedDocumentValidator
- Type Parameters:
T
-AdvancedSignature
implementation- Parameters:
signatures
- a collection ofAdvancedSignature
sdetachedTimestamps
- a collection of detachedTimestampToken
s- Returns:
ValidationDataContainer
-
instantiateValidationDataContainer
Description copied from class:SignedDocumentValidator
Creates a new instance ofValidationDataContainer
- Overrides:
instantiateValidationDataContainer
in classSignedDocumentValidator
- Returns:
ValidationDataContainer
-
getOriginalDocuments
Description copied from interface:DocumentValidator
This method returns the signed document(s) without their signature(s)- Parameters:
advancedSignature
-AdvancedSignature
to find signer documents for- Returns:
- list of
DSSDocument
s
-