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
ConstructorsModifierConstructorDescriptionprotectedEmpty constructorPDFDocumentValidator(DSSDocument document) The default constructor for PDFDocumentValidator. -
Method Summary
Modifier and TypeMethodDescriptionprotected List<TimestampToken>Builds a list of detachedTimestampTokens 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 PAdESTimestampScopeFinderThis 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 PAdESDiagnosticDataBuilderInitializes a relevantDiagnosticDataBuilderfor the given implementationprotected PdfValidationDataContainerCreates a new instance ofValidationDataContainerbooleanisSupported(DSSDocument dssDocument) Checks if the document is supported by the current validatorprotected voidpostProcessing(List<AdvancedSignature> signatures) Post-process the extracted signatures NOTE: the method shall be used only for the document validationprotected voidprepareDssDictionaryValidationContext(ValidationContext validationContext, List<PdfDocDssRevision> dssRevisions) Fills thevalidateContextwith certificate tokens fromdssDictsprotected <T extends AdvancedSignature>
ValidationContextprepareValidationContext(Collection<T> signatures, Collection<TimestampToken> detachedTimestamps, CertificateVerifier certificateVerifier) Initializes and fillsValidationContextwith necessary data sourcesvoidsetPasswordProtection(char[] passwordProtection) Specify the used password for the encrypted documentvoidDeprecated.since DSS 5.12.voidsetPdfObjFactory(IPdfObjFactory pdfObjFactory) Set the IPdfObjFactory.protected voidtimestampPostProcessing(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:SignedDocumentValidatorChecks if the document is supported by the current validator- Specified by:
isSupportedin classSignedDocumentValidator- Parameters:
dssDocument-DSSDocumentto 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:SignedDocumentValidatorInitializes and fillsValidationContextwith necessary data sources- Overrides:
prepareValidationContextin classSignedDocumentValidator- Type Parameters:
T-AdvancedSignatureimplementation- Parameters:
signatures- a collection ofAdvancedSignaturesdetachedTimestamps- a collection of detachedTimestampTokenscertificateVerifier-CertificateVerifierto be used for the validation- Returns:
ValidationContext
-
initializeDiagnosticDataBuilder
Description copied from class:SignedDocumentValidatorInitializes a relevantDiagnosticDataBuilderfor the given implementation- Overrides:
initializeDiagnosticDataBuilderin classSignedDocumentValidator- Returns:
SignedDocumentDiagnosticDataBuilder
-
prepareDssDictionaryValidationContext
protected void prepareDssDictionaryValidationContext(ValidationContext validationContext, List<PdfDocDssRevision> dssRevisions) Fills thevalidateContextwith certificate tokens fromdssDicts- Parameters:
validationContext-ValidationContextto enrichdssRevisions- a list ofPdfDocDssRevisions
-
getAllSignatures
Description copied from class:SignedDocumentValidatorReturns a list of all signatures from the validating document- Overrides:
getAllSignaturesin classSignedDocumentValidator- Returns:
- a list of
AdvancedSignatures
-
postProcessing
Post-process the extracted signatures NOTE: the method shall be used only for the document validation- Parameters:
signatures- a list ofAdvancedSignatures
-
getDetachedTimestamps
Description copied from interface:DocumentValidatorRetrieves the detached timestamps found in the document- Specified by:
getDetachedTimestampsin interfaceDocumentValidator- Overrides:
getDetachedTimestampsin 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 ofTimestampTokens
-
buildSignatures
Description copied from class:SignedDocumentValidatorThis method build a list of signatures to be extracted from a document- Overrides:
buildSignaturesin classSignedDocumentValidator- Returns:
- a list of
AdvancedSignatures
-
buildDetachedTimestamps
Description copied from class:SignedDocumentValidatorBuilds a list of detachedTimestampTokens extracted from the document- Overrides:
buildDetachedTimestampsin classSignedDocumentValidator- Returns:
- a list of
TimestampTokens
-
findSignatureScopes
Description copied from class:SignedDocumentValidatorFinds and assigns SignatureScopes for a list of signatures- Specified by:
findSignatureScopesin interfaceDocumentValidator- Overrides:
findSignatureScopesin classSignedDocumentValidator- Type Parameters:
T-AdvancedSignatureimplementation- Parameters:
allSignatures- a list ofAdvancedSignatures 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
PdfDssDicts
-
getDssRevisions
This method returns a list of DSS revisions- Returns:
- a list of
PdfDocDssRevisions
-
getRevisions
Gets the list of PDF document revisions- Returns:
- a list of
PdfRevisions
-
getValidationData
public <T extends AdvancedSignature> PdfValidationDataContainer getValidationData(Collection<T> signatures, Collection<TimestampToken> detachedTimestamps) Description copied from interface:DocumentValidatorExtracts a validation data for provided collection of signatures and/or timestamps- Specified by:
getValidationDatain interfaceDocumentValidator- Overrides:
getValidationDatain classSignedDocumentValidator- Type Parameters:
T-AdvancedSignatureimplementation- Parameters:
signatures- a collection ofAdvancedSignaturesdetachedTimestamps- a collection of detachedTimestampTokens- Returns:
ValidationDataContainer
-
instantiateValidationDataContainer
Description copied from class:SignedDocumentValidatorCreates a new instance ofValidationDataContainer- Overrides:
instantiateValidationDataContainerin classSignedDocumentValidator- Returns:
ValidationDataContainer
-
getOriginalDocuments
Description copied from interface:DocumentValidatorThis method returns the signed document(s) without their signature(s)- Parameters:
advancedSignature-AdvancedSignatureto find signer documents for- Returns:
- list of
DSSDocuments
-