Package eu.europa.esig.dss.validation
Interface DocumentValidator
- All Superinterfaces:
ProcessExecutorProvider<DocumentProcessExecutor>
- All Known Subinterfaces:
EvidenceRecordValidator
- All Known Implementing Classes:
AbstractASiCContainerValidator
,AbstractJWSDocumentValidator
,ASiCContainerWithCAdESValidator
,ASiCContainerWithXAdESValidator
,ASiCWithCAdESTimestampValidator
,ASN1EvidenceRecordValidator
,CMSDocumentValidator
,DefaultEvidenceRecordValidator
,DetachedTimestampValidator
,JWSCompactDocumentValidator
,JWSSerializationDocumentValidator
,PDFADocumentValidator
,PDFDocumentValidator
,SignedDocumentValidator
,XMLDocumentValidator
,XMLEvidenceRecordValidator
This is the interface to be used when implementing different signature validators.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the detached evidence records found in the documentRetrieves the detached timestamps found in the documentgetOriginalDocuments
(AdvancedSignature advancedSignature) This method returns the signed document(s) without their signature(s)getOriginalDocuments
(String signatureId) This method returns the signed document(s) without their signature(s)Retrieves the signatures found in the document<T extends AdvancedSignature>
ValidationDataContainergetValidationData
(Collection<T> signatures) Extracts a validation data for provided collection of signatures<T extends AdvancedSignature>
ValidationDataContainergetValidationData
(Collection<T> signatures, Collection<TimestampToken> detachedTimestamps) Extracts a validation data for provided collection of signatures and/or timestampsvoid
setCertificateVerifier
(CertificateVerifier certificateVerifier) Provides aCertificateVerifier
to be used during the validation process.void
setContainerContents
(List<DSSDocument> archiveContents) Sets theList
ofDSSDocument
containing the original container content for ASiC-S signatures.void
setDefaultDigestAlgorithm
(DigestAlgorithm digestAlgorithm) This method allows to change the Digest Algorithm that will be used for tokens' digest calculation Default :DigestAlgorithm.SHA256
void
setDetachedContents
(List<DSSDocument> detachedContent) Sets theList
ofDSSDocument
containing the original contents to sign, for detached signature scenarios.void
setDetachedEvidenceRecordDocuments
(List<DSSDocument> detachedEvidenceRecordDocuments) Sets aList
ofDSSDocument
containing the evidence record documents covering the signature document.void
setEnableEtsiValidationReport
(boolean enableEtsiValidationReport) This method allows to specify if the ETSI Validation Report must be generated.void
setIncludeSemantics
(boolean include) This method allows to enable/disable the semantics inclusion in the reports (Indication / SubIndication meanings) Disabled by defaultvoid
setManifestFile
(ManifestFile manifestFile) Sets a relatedManifestFile
to the document to be validated.void
setSignaturePolicyProvider
(SignaturePolicyProvider signaturePolicyProvider) This method allows to set a provider for Signature policiesvoid
setSigningCertificateSource
(CertificateSource certificateSource) Set a certificate source which allows to find the signing certificate by kid or certificate's digestvoid
setTokenExtractionStrategy
(TokenExtractionStrategy tokenExtractionStrategy) This method allows to set the token extraction strategy to follow in the diagnostic data generation.void
setTokenIdentifierProvider
(TokenIdentifierProvider tokenIdentifierProvider) Sets the TokenIdentifierProvidervoid
setValidationContextExecutor
(ValidationContextExecutor validationContextExecutor) This method setsValidationContextExecutor
for validation of the preparedValidationContext
Default:eu.europa.esig.dss.validation.executor.context.DefaultValidationContextExecutor
(performs basic validation of tokens, including certificate chain building and revocation data extraction, without processing of validity checks)void
setValidationLevel
(ValidationLevel validationLevel) This method allows to specify the validation level (Basic / Timestamp / Long Term / Archival).void
setValidationTime
(Date validationTime) Allows to define a custom validation timeValidates the document and all its signatures.validateDocument
(DSSDocument policyDocument) Validates the document and all its signatures.validateDocument
(ConstraintsParameters validationPolicyJaxb) Validates the document and all its signatures.validateDocument
(ValidationPolicy validationPolicy) Validates the document and all its signatures.validateDocument
(File policyFile) Validates the document and all its signatures.validateDocument
(InputStream policyDataStream) Validates the document and all its signatures.validateDocument
(String policyResourcePath) Validates the document and all its signatures.validateDocument
(URL validationPolicyURL) Validates the document and all its signatures.Methods inherited from interface eu.europa.esig.dss.validation.executor.ProcessExecutorProvider
getDefaultProcessExecutor, setProcessExecutor
-
Method Details
-
getSignatures
List<AdvancedSignature> getSignatures()Retrieves the signatures found in the document- Returns:
- a list of AdvancedSignatures for validation purposes
-
getDetachedTimestamps
List<TimestampToken> getDetachedTimestamps()Retrieves the detached timestamps found in the document- Returns:
- a list of TimestampToken for validation purposes
-
getDetachedEvidenceRecords
List<EvidenceRecord> getDetachedEvidenceRecords()Retrieves the detached evidence records found in the document- Returns:
- a list of Evidence Records for validation purposes
-
setCertificateVerifier
Provides aCertificateVerifier
to be used during the validation process.- Parameters:
certificateVerifier
-CertificateVerifier
-
setValidationContextExecutor
This method setsValidationContextExecutor
for validation of the preparedValidationContext
Default:eu.europa.esig.dss.validation.executor.context.DefaultValidationContextExecutor
(performs basic validation of tokens, including certificate chain building and revocation data extraction, without processing of validity checks)- Parameters:
validationContextExecutor
-ValidationContextExecutor
-
setDefaultDigestAlgorithm
This method allows to change the Digest Algorithm that will be used for tokens' digest calculation Default :DigestAlgorithm.SHA256
- Parameters:
digestAlgorithm
-DigestAlgorithm
to use
-
setTokenExtractionStrategy
This method allows to set the token extraction strategy to follow in the diagnostic data generation.- Parameters:
tokenExtractionStrategy
- theTokenExtractionStrategy
-
setTokenIdentifierProvider
Sets the TokenIdentifierProvider- Parameters:
tokenIdentifierProvider
-TokenIdentifierProvider
-
setIncludeSemantics
void setIncludeSemantics(boolean include) This method allows to enable/disable the semantics inclusion in the reports (Indication / SubIndication meanings) Disabled by default- Parameters:
include
- true to enable the inclusion of the semantics
-
setValidationTime
-
setDetachedContents
Sets theList
ofDSSDocument
containing the original contents to sign, for detached signature scenarios.- Parameters:
detachedContent
- theList
ofDSSDocument
to set
-
setDetachedEvidenceRecordDocuments
Sets aList
ofDSSDocument
containing the evidence record documents covering the signature document.- Parameters:
detachedEvidenceRecordDocuments
- theList
ofDSSDocument
to set
-
setContainerContents
Sets theList
ofDSSDocument
containing the original container content for ASiC-S signatures.- Parameters:
archiveContents
- theList
ofDSSDocument
to set
-
setManifestFile
Sets a relatedManifestFile
to the document to be validated.- Parameters:
manifestFile
- aManifestFile
to set
-
setSigningCertificateSource
Set a certificate source which allows to find the signing certificate by kid or certificate's digest- Parameters:
certificateSource
- the certificate source
-
setValidationLevel
This method allows to specify the validation level (Basic / Timestamp / Long Term / Archival). By default, the selected validation is ARCHIVAL- Parameters:
validationLevel
-ValidationLevel
-
setEnableEtsiValidationReport
void setEnableEtsiValidationReport(boolean enableEtsiValidationReport) This method allows to specify if the ETSI Validation Report must be generated. Default : TRUE (the ETSI Validation report will be generated).- Parameters:
enableEtsiValidationReport
- - TRUE if the report must be generated, FALSE otherwise
-
setSignaturePolicyProvider
This method allows to set a provider for Signature policies- Parameters:
signaturePolicyProvider
-SignaturePolicyProvider
-
validateDocument
Reports validateDocument()Validates the document and all its signatures. The default constraint file is used.- Returns:
Reports
: diagnostic data, detailed report and simple report
-
validateDocument
Validates the document and all its signatures. If the validation policy URL is set then the policy constraints are retrieved from this location. If null or empty the default file is used.- Parameters:
validationPolicyURL
-URL
- Returns:
Reports
: diagnostic data, detailed report and simple report
-
validateDocument
Validates the document and all its signatures. The policyResourcePath specifies the constraint file. If null or empty the default file is used.- Parameters:
policyResourcePath
- is located against the classpath (getClass().getResourceAsStream), and NOT the filesystem- Returns:
Reports
: diagnostic data, detailed report and simple report
-
validateDocument
Validates the document and all its signatures. TheFile
parameter specifies the constraint file. If null or empty the default file is used.- Parameters:
policyFile
- contains the validation policy (xml) asFile
- Returns:
Reports
: diagnostic data, detailed report and simple report
-
validateDocument
Validates the document and all its signatures. The policyDataStream contains the constraint file. If null or empty the default file is used.- Parameters:
policyDocument
- contains the validation policy (xml) asDSSDocument
- Returns:
Reports
: diagnostic data, detailed report and simple report
-
validateDocument
Validates the document and all its signatures. The policyDataStream contains the constraint file. If null or empty the default file is used.- Parameters:
policyDataStream
- contains the validation policy (xml) asInputStream
- Returns:
Reports
: diagnostic data, detailed report and simple report
-
validateDocument
Validates the document and all its signatures. ThevalidationPolicyJaxb
contains the constraint file. If null or empty the default file is used.- Parameters:
validationPolicyJaxb
-ConstraintsParameters
- Returns:
Reports
-
validateDocument
Validates the document and all its signatures. ThevalidationPolicy
contains the constraint file. If null or empty the default file is used.- Parameters:
validationPolicy
-ValidationPolicy
- Returns:
Reports
-
getOriginalDocuments
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- Returns:
- list of
DSSDocument
s
-
getOriginalDocuments
This method returns the signed document(s) without their signature(s)- Parameters:
advancedSignature
-AdvancedSignature
to find signer documents for- Returns:
- list of
DSSDocument
s
-
getValidationData
Extracts a validation data for provided collection of signatures- Type Parameters:
T
-AdvancedSignature
implementation- Parameters:
signatures
- a collection ofAdvancedSignature
s- Returns:
ValidationDataContainer
-
getValidationData
<T extends AdvancedSignature> ValidationDataContainer getValidationData(Collection<T> signatures, Collection<TimestampToken> detachedTimestamps) Extracts a validation data for provided collection of signatures and/or timestamps- Type Parameters:
T
-AdvancedSignature
implementation- Parameters:
signatures
- a collection ofAdvancedSignature
sdetachedTimestamps
- a collection of detachedTimestampToken
s- Returns:
ValidationDataContainer
-