Class PDFDocumentAnalyzer
java.lang.Object
eu.europa.esig.dss.spi.validation.analyzer.DefaultDocumentAnalyzer
eu.europa.esig.dss.pades.validation.PDFDocumentAnalyzer
- All Implemented Interfaces:
DocumentAnalyzer
- Direct Known Subclasses:
PDFADocumentAnalyzer
Validation of PDF document.
-
Field Summary
Fields inherited from class eu.europa.esig.dss.spi.validation.analyzer.DefaultDocumentAnalyzer
certificateVerifier, containerContents, detachedContents, detachedEvidenceRecordDocuments, document, manifestFile, signingCertificateSource
-
Constructor Summary
ModifierConstructorDescriptionprotected
Empty constructorPDFDocumentAnalyzer
(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 documentprotected 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 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, Collection<EvidenceRecord> detachedEvidenceRecords, CertificateVerifier certificateVerifier) Initializes and fillsValidationContext
with necessary data sourcesvoid
setPasswordProtection
(char[] passwordProtection) Specify the used password for the encrypted documentvoid
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.spi.validation.analyzer.DefaultDocumentAnalyzer
addReference, appendCounterSignatures, appendExternalEvidenceRecords, appendExternalEvidenceRecords, buildDetachedEvidenceRecords, buildEvidenceRecord, coversSignature, createValidationContext, fromDocument, getAllEvidenceRecords, getDetachedEvidenceRecords, getDocument, getEvidenceRecord, getEvidenceRecordScopes, getOriginalDocuments, getSignatureById, getSignaturePolicyProvider, getSignaturePolicyValidatorLoader, getSignatures, getTimestampedReferences, getTimestampReaders, getTokenIdentifierProvider, getValidationData, getValidationTime, isTimestampCoveredByEvidenceRecord, prepareDetachedEvidenceRecordValidationContext, prepareDetachedTimestampValidationContext, prepareSignatureForVerification, prepareSignatureValidationContext, processSignaturesValidation, setCertificateVerifier, setContainerContents, setDetachedContents, setDetachedEvidenceRecordDocuments, setDetachedEvidenceRecords, setManifestFile, setSignaturePolicyProvider, setSigningCertificateSource, setTokenIdentifierProvider, setValidationContextExecutor, setValidationTime, validate, validateContext, validateSignaturePolicy
-
Constructor Details
-
PDFDocumentAnalyzer
protected PDFDocumentAnalyzer()Empty constructor -
PDFDocumentAnalyzer
The default constructor for PDFDocumentValidator.- Parameters:
document
-DSSDocument
-
-
Method Details
-
isSupported
Description copied from interface:DocumentAnalyzer
Checks if the document is supported by the current validator- 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
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, Collection<EvidenceRecord> detachedEvidenceRecords, CertificateVerifier certificateVerifier) Description copied from class:DefaultDocumentAnalyzer
Initializes and fillsValidationContext
with necessary data sources- Overrides:
prepareValidationContext
in classDefaultDocumentAnalyzer
- Type Parameters:
T
-AdvancedSignature
implementation- Parameters:
signatures
- a collection ofAdvancedSignature
sdetachedTimestamps
- a collection of detachedTimestampToken
sdetachedEvidenceRecords
- a collection of detachedEvidenceRecord
scertificateVerifier
-CertificateVerifier
to be used for the validation- Returns:
ValidationContext
-
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:DefaultDocumentAnalyzer
Returns a list of all signatures from the validating document- Overrides:
getAllSignatures
in classDefaultDocumentAnalyzer
- 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:DocumentAnalyzer
Retrieves the detached timestamps found in the document- Specified by:
getDetachedTimestamps
in interfaceDocumentAnalyzer
- Overrides:
getDetachedTimestamps
in classDefaultDocumentAnalyzer
- 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:DefaultDocumentAnalyzer
This method build a list of signatures to be extracted from a document- Overrides:
buildSignatures
in classDefaultDocumentAnalyzer
- Returns:
- a list of
AdvancedSignature
s
-
buildDetachedTimestamps
Description copied from class:DefaultDocumentAnalyzer
Builds a list of detachedTimestampToken
s extracted from the document- Overrides:
buildDetachedTimestamps
in classDefaultDocumentAnalyzer
- Returns:
- a list of
TimestampToken
s
-
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:DocumentAnalyzer
Extracts a validation data for provided collection of signatures and/or timestamps- Specified by:
getValidationData
in interfaceDocumentAnalyzer
- Overrides:
getValidationData
in classDefaultDocumentAnalyzer
- Type Parameters:
T
-AdvancedSignature
implementation- Parameters:
signatures
- a collection ofAdvancedSignature
sdetachedTimestamps
- a collection of detachedTimestampToken
s- Returns:
ValidationDataContainer
-
instantiateValidationDataContainer
Description copied from class:DefaultDocumentAnalyzer
Creates a new instance ofValidationDataContainer
- Overrides:
instantiateValidationDataContainer
in classDefaultDocumentAnalyzer
- Returns:
ValidationDataContainer
-
getOriginalDocuments
Description copied from interface:DocumentAnalyzer
This method returns the signed document(s) without their signature(s)- Parameters:
advancedSignature
-AdvancedSignature
to find signer documents for- Returns:
- list of
DSSDocument
s
-