Class PDFDocumentValidator
java.lang.Object
eu.europa.esig.dss.validation.SignedDocumentValidator
eu.europa.esig.dss.pades.validation.PDFDocumentValidator
- All Implemented Interfaces:
DocumentValidator,ProcessExecutorProvider<DocumentProcessExecutor>
public class PDFDocumentValidator extends SignedDocumentValidator
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
Constructors Constructor Description PDFDocumentValidator(DSSDocument document)The default constructor for PDFDocumentValidator. -
Method Summary
Modifier and Type Method Description List<TimestampToken>getDetachedTimestamps()Retrieves the detached timestamps found in the documentList<PdfDssDict>getDssDictionaries()Returns a list of found DSS Dictionaries across different revisionsList<DSSDocument>getOriginalDocuments(AdvancedSignature advancedSignature)This method returns the signed document(s) without their signature(s)List<DSSDocument>getOriginalDocuments(String signatureId)This method returns the signed document(s) without their signature(s)protected List<PdfRevision>getRevisions()Gets the list of PDF document revisionsList<AdvancedSignature>getSignatures()Retrieves the signatures found in the documentprotected PAdESDiagnosticDataBuilderinitializeDiagnosticDataBuilder()Initializes a relevantDiagnosticDataBuilderfor the given implementationbooleanisSupported(DSSDocument dssDocument)Checks if the document is supported by the current validatorprotected ListCertificateSourcemergeCertificateSource(Collection<AdvancedSignature> allSignatureList, Collection<TimestampToken> detachedTimestamps, List<PdfDssDict> dssDictionaries)Merges the certificate tokens sourcesprotected ListRevocationSource<CRL>mergeCRLSources(Collection<AdvancedSignature> allSignatures, Collection<TimestampToken> timestampTokens, Collection<PdfDssDict> dssDictionaries)Merges the CRL sourcesprotected ListRevocationSource<OCSP>mergeOCSPSources(Collection<AdvancedSignature> allSignatures, Collection<TimestampToken> timestampTokens, Collection<PdfDssDict> dssDictionaries)Merges the OCSP sourcesprotected voidpopulateFromDssDictionaries(ValidationContext validationContext, List<PdfDssDict> dssDicts)Fills thevalidateContextwith certificate tokens fromdssDictsprotected DiagnosticDataBuilderprepareDiagnosticDataBuilder(ValidationContext validationContext)Creates aDiagnosticDataBuildervoidsetPasswordProtection(String pwd)Specify the used password for the encrypted documentvoidsetPdfObjFactory(IPdfObjFactory pdfObjFactory)Set the IPdfObjFactory.Methods inherited from class eu.europa.esig.dss.validation.SignedDocumentValidator
appendCounterSignatures, assertConfigurationValid, createDiagnosticDataBuilder, defineSigningCertificate, findSignatureScopes, fromDocument, getAllSignatures, getDefaultDigestAlgorithm, getDefaultProcessExecutor, getSignaturePolicyProvider, getValidationTime, mergeCertificateSource, mergeCRLSources, mergeOCSPSources, prepareCertificatesAndTimestamps, prepareCertificateVerifier, prepareDetachedTimestampValidationContext, prepareSignatureValidationContext, processSignaturesValidation, processValidationPolicy, provideProcessExecutorInstance, setCertificateVerifier, setContainerContents, setDetachedContents, setEnableEtsiValidationReport, setIncludeSemantics, setLocale, setManifestFile, setProcessExecutor, setSignaturePolicyProvider, setSignedScopeFinderDefaultDigestAlgorithm, setSigningCertificateSource, setSkipValidationContextExecution, setTokenExtractionStrategy, setValidationLevel, setValidationTime, validateContext, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument
-
Constructor Details
-
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
Specify the used password for the encrypted document- Parameters:
pwd- the used password
-
prepareDiagnosticDataBuilder
Description copied from class:SignedDocumentValidatorCreates aDiagnosticDataBuilder- Overrides:
prepareDiagnosticDataBuilderin classSignedDocumentValidator- Parameters:
validationContext-ValidationContext- Returns:
DiagnosticDataBuilder
-
initializeDiagnosticDataBuilder
Description copied from class:SignedDocumentValidatorInitializes a relevantDiagnosticDataBuilderfor the given implementation- Overrides:
initializeDiagnosticDataBuilderin classSignedDocumentValidator- Returns:
SignedDocumentDiagnosticDataBuilder
-
mergeCRLSources
protected ListRevocationSource<CRL> mergeCRLSources(Collection<AdvancedSignature> allSignatures, Collection<TimestampToken> timestampTokens, Collection<PdfDssDict> dssDictionaries)Merges the CRL sources- Parameters:
allSignatures- a collection ofAdvancedSignaturestimestampTokens- a collection ofTimestampTokensdssDictionaries- a collection ofPdfDssDicts- Returns:
- merged
ListRevocationSource
-
mergeOCSPSources
protected ListRevocationSource<OCSP> mergeOCSPSources(Collection<AdvancedSignature> allSignatures, Collection<TimestampToken> timestampTokens, Collection<PdfDssDict> dssDictionaries)Merges the OCSP sources- Parameters:
allSignatures- a collection ofAdvancedSignaturestimestampTokens- a collection ofTimestampTokensdssDictionaries- a collection ofPdfDssDicts- Returns:
- merged
ListRevocationSource
-
populateFromDssDictionaries
protected void populateFromDssDictionaries(ValidationContext validationContext, List<PdfDssDict> dssDicts)Fills thevalidateContextwith certificate tokens fromdssDicts- Parameters:
validationContext-ValidationContextto enrichdssDicts- a list ofPdfDssDicts
-
mergeCertificateSource
protected ListCertificateSource mergeCertificateSource(Collection<AdvancedSignature> allSignatureList, Collection<TimestampToken> detachedTimestamps, List<PdfDssDict> dssDictionaries)Merges the certificate tokens sources- Parameters:
allSignatureList- a collection ofAdvancedSignaturesdetachedTimestamps- a collection ofTimestampTokensdssDictionaries- a collection ofPdfDssDicts- Returns:
- merged
ListRevocationSource
-
getSignatures
Description copied from interface:DocumentValidatorRetrieves the signatures found in the document- Specified by:
getSignaturesin interfaceDocumentValidator- Overrides:
getSignaturesin classSignedDocumentValidator- Returns:
- a list of AdvancedSignatures for validation purposes
-
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
-
getDssDictionaries
Returns a list of found DSS Dictionaries across different revisions- Returns:
- list of
PdfDssDicts
-
getRevisions
Gets the list of PDF document revisions- Returns:
- a list of
PdfRevisions
-
getOriginalDocuments
Description copied from interface:DocumentValidatorThis method returns the signed document(s) without their signature(s)- Parameters:
signatureId- the DSS ID of the signature to extract original signer data for- Returns:
- list of
DSSDocuments
-
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
-