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, manifestFiles, processExecutor, providedSigningCertificateToken, signatureScopeFinder, 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()
List<AdvancedSignature>
getSignatures()
Retrieves the signatures found in the documentboolean
isSupported(DSSDocument dssDocument)
protected ListCertificateSource
mergeCertificateSource(Collection<AdvancedSignature> allSignatureList, Collection<TimestampToken> detachedTimestamps, List<PdfDssDict> dssDictionaries)
protected ListRevocationSource<CRL>
mergeCRLSources(Collection<AdvancedSignature> allSignatures, Collection<TimestampToken> timestampTokens, Collection<PdfDssDict> dssDictionaries)
protected ListRevocationSource<OCSP>
mergeOCSPSources(Collection<AdvancedSignature> allSignatures, Collection<TimestampToken> timestampTokens, Collection<PdfDssDict> dssDictionaries)
protected void
populateFromDssDictionaries(ValidationContext validationContext, List<PdfDssDict> dssDicts)
protected DiagnosticDataBuilder
prepareDiagnosticDataBuilder(ValidationContext validationContext)
Creates a DiagnosticData to pass to the validation processvoid
setPasswordProtection(String pwd)
Specify the used password for the encrypted documentvoid
setPdfObjFactory(IPdfObjFactory pdfObjFactory)
Set the IPdfObjFactory.Methods inherited from class eu.europa.esig.dss.validation.SignedDocumentValidator
assertConfigurationValid, defineSigningCertificate, findSignatureScopes, fromDocument, getAllSignatures, getDefaultDigestAlgorithm, getDefaultProcessExecutor, getDiagnosticDataBuilderConfiguration, getSignaturePolicyProvider, getValidationTime, mergeCertificateSource, mergeCRLSources, mergeOCSPSources, prepareCertificatesAndTimestamps, prepareCertificateVerifier, prepareDetachedTimestampValidationContext, prepareSignatureValidationContext, processSignaturesValidation, processValidationPolicy, provideProcessExecutorInstance, setCertificateVerifier, setContainerContents, setDetachedContents, setEnableEtsiValidationReport, setIncludeSemantics, setLocale, setManifestFiles, setProcessExecutor, setSignaturePolicyProvider, setSignedScopeFinderDefaultDigestAlgorithm, setSkipValidationContextExecution, setTokenExtractionStategy, setValidationLevel, setValidationTime, validateContext, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument
-
Constructor Details
-
PDFDocumentValidator
The default constructor for PDFDocumentValidator.
-
-
Method Details
-
isSupported
- Specified by:
isSupported
in classSignedDocumentValidator
-
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:SignedDocumentValidator
Creates a DiagnosticData to pass to the validation process- Overrides:
prepareDiagnosticDataBuilder
in classSignedDocumentValidator
- Parameters:
validationContext
-ValidationContext
- Returns:
DiagnosticData
-
mergeCRLSources
protected ListRevocationSource<CRL> mergeCRLSources(Collection<AdvancedSignature> allSignatures, Collection<TimestampToken> timestampTokens, Collection<PdfDssDict> dssDictionaries) -
mergeOCSPSources
protected ListRevocationSource<OCSP> mergeOCSPSources(Collection<AdvancedSignature> allSignatures, Collection<TimestampToken> timestampTokens, Collection<PdfDssDict> dssDictionaries) -
populateFromDssDictionaries
protected void populateFromDssDictionaries(ValidationContext validationContext, List<PdfDssDict> dssDicts) -
mergeCertificateSource
protected ListCertificateSource mergeCertificateSource(Collection<AdvancedSignature> allSignatureList, Collection<TimestampToken> detachedTimestamps, List<PdfDssDict> dssDictionaries) -
getSignatures
Description copied from interface:DocumentValidator
Retrieves the signatures found in the document- Specified by:
getSignatures
in interfaceDocumentValidator
- Overrides:
getSignatures
in classSignedDocumentValidator
- Returns:
- a list of AdvancedSignatures for validation purposes
-
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
-
getDssDictionaries
Returns a list of found DSS Dictionaries across different revisions- Returns:
- list of
PdfDssDict
s
-
getRevisions
-
getOriginalDocuments
Description copied from interface:DocumentValidator
This method returns the signed document(s) without their signature(s)- Parameters:
signatureId
- the DSS ID of the signature to extract original signer data for
-
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
-