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
ConstructorsModifierConstructorDescriptionprotectedEmpty constructorPDFDocumentAnalyzer(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 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 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 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, Collection<EvidenceRecord> detachedEvidenceRecords, CertificateVerifier certificateVerifier) Initializes and fillsValidationContextwith necessary data sourcesvoidsetPasswordProtection(char[] passwordProtection) Specify the used password for the encrypted documentvoidsetPdfObjFactory(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.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:DocumentAnalyzerChecks if the document is supported by the current validator- 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
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:DefaultDocumentAnalyzerInitializes and fillsValidationContextwith necessary data sources- Overrides:
prepareValidationContextin classDefaultDocumentAnalyzer- Type Parameters:
T-AdvancedSignatureimplementation- Parameters:
signatures- a collection ofAdvancedSignaturesdetachedTimestamps- a collection of detachedTimestampTokensdetachedEvidenceRecords- a collection of detachedEvidenceRecordscertificateVerifier-CertificateVerifierto be used for the validation- Returns:
ValidationContext
-
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:DefaultDocumentAnalyzerReturns a list of all signatures from the validating document- Overrides:
getAllSignaturesin classDefaultDocumentAnalyzer- 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:DocumentAnalyzerRetrieves the detached timestamps found in the document- Specified by:
getDetachedTimestampsin interfaceDocumentAnalyzer- Overrides:
getDetachedTimestampsin 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 ofTimestampTokens
-
buildSignatures
Description copied from class:DefaultDocumentAnalyzerThis method build a list of signatures to be extracted from a document- Overrides:
buildSignaturesin classDefaultDocumentAnalyzer- Returns:
- a list of
AdvancedSignatures
-
buildDetachedTimestamps
Description copied from class:DefaultDocumentAnalyzerBuilds a list of detachedTimestampTokens extracted from the document- Overrides:
buildDetachedTimestampsin classDefaultDocumentAnalyzer- Returns:
- a list of
TimestampTokens
-
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:DocumentAnalyzerExtracts a validation data for provided collection of signatures and/or timestamps- Specified by:
getValidationDatain interfaceDocumentAnalyzer- Overrides:
getValidationDatain classDefaultDocumentAnalyzer- Type Parameters:
T-AdvancedSignatureimplementation- Parameters:
signatures- a collection ofAdvancedSignaturesdetachedTimestamps- a collection of detachedTimestampTokens- Returns:
ValidationDataContainer
-
instantiateValidationDataContainer
Description copied from class:DefaultDocumentAnalyzerCreates a new instance ofValidationDataContainer- Overrides:
instantiateValidationDataContainerin classDefaultDocumentAnalyzer- Returns:
ValidationDataContainer
-
getOriginalDocuments
Description copied from interface:DocumentAnalyzerThis method returns the signed document(s) without their signature(s)- Parameters:
advancedSignature-AdvancedSignatureto find signer documents for- Returns:
- list of
DSSDocuments
-