Package eu.europa.esig.dss.validation
Interface DocumentValidator
- All Superinterfaces:
ProcessExecutorProvider<DocumentProcessExecutor>
- All Known Implementing Classes:
AbstractASiCContainerValidator
,ASiCContainerWithCAdESValidator
,ASiCContainerWithXAdESValidator
,ASiCEWithCAdESTimestampValidator
,CMSDocumentForASiCValidator
,CMSDocumentValidator
,DetachedTimestampValidator
,PDFDocumentValidator
,SignedDocumentValidator
,XMLDocumentForASiCValidator
,XMLDocumentValidator
public interface DocumentValidator extends ProcessExecutorProvider<DocumentProcessExecutor>
This is the interface to be used when implementing different signature validators.
-
Method Summary
Modifier and Type Method Description void
defineSigningCertificate(CertificateToken x509Certificate)
This method allows to define the signing certificate.void
findSignatureScopes(List<AdvancedSignature> currentValidatorSignatures)
List<TimestampToken>
getDetachedTimestamps()
Retrieves the detached timestamps found in the documentList<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)List<AdvancedSignature>
getSignatures()
Retrieves the signatures found in the documentvoid
prepareDetachedTimestampValidationContext(ValidationContext validationContext, List<TimestampToken> timestamps)
Prepares thevalidationContext
for a timestamp validation processvoid
prepareSignatureValidationContext(ValidationContext validationContext, List<AdvancedSignature> allSignatures)
Prepares thevalidationContext
for signature validation process and returns a list of signatures to validatevoid
processSignaturesValidation(List<AdvancedSignature> allSignatureList)
This method process the signature validation on the givenallSignatureList
void
setCertificateVerifier(CertificateVerifier certVerifier)
Provides aCertificateVerifier
to be used during the validation process.void
setContainerContents(List<DSSDocument> archiveContents)
Sets theList
ofDSSDocument
containing the original container content for ASiC signatures.void
setDetachedContents(List<DSSDocument> detachedContent)
Sets theList
ofDSSDocument
containing the original contents to sign, for detached signature scenarios.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
setManifestFiles(List<ManifestFile> manifestFiles)
Sets theList
ofManifestFile
s found in the signature file.void
setSignaturePolicyProvider(SignaturePolicyProvider signaturePolicyProvider)
This method allows to set a provider for Signature policiesvoid
setTokenExtractionStategy(TokenExtractionStategy tokenExtractionStategy)
This method allows to set the token extraction strategy to follow in the diagnostic data generation.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 timeReports
validateDocument()
Validates the document and all its signatures.Reports
validateDocument(ConstraintsParameters validationPolicyJaxb)
Validates the document and all its signatures.Reports
validateDocument(ValidationPolicy validationPolicy)
Validates the document and all its signatures.Reports
validateDocument(File policyFile)
Validates the document and all its signatures.Reports
validateDocument(InputStream policyDataStream)
Validates the document and all its signatures.Reports
validateDocument(String policyResourcePath)
Validates the document and all its signatures.Reports
validateDocument(URL validationPolicyURL)
Validates the document and all its signatures.Methods inherited from interface eu.europa.esig.dss.validation.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
-
setCertificateVerifier
Provides aCertificateVerifier
to be used during the validation process.- Parameters:
certVerifier
-CertificateVerifier
-
setTokenExtractionStategy
This method allows to set the token extraction strategy to follow in the diagnostic data generation.- Parameters:
tokenExtractionStategy
- theTokenExtractionStategy
-
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
Allows to define a custom validation time- Parameters:
validationTime
-Date
-
setDetachedContents
Sets theList
ofDSSDocument
containing the original contents to sign, for detached signature scenarios.- Parameters:
detachedContent
- theList
ofDSSDocument
to set
-
setContainerContents
Sets theList
ofDSSDocument
containing the original container content for ASiC signatures.- Parameters:
archiveContents
- theList
ofDSSDocument
to set
-
setManifestFiles
Sets theList
ofManifestFile
s found in the signature file.- Parameters:
manifestFiles
- theList
ofManifestFile
to set
-
defineSigningCertificate
This method allows to define the signing certificate. It is useful in the case of non AdES signatures.- Parameters:
x509Certificate
-
-
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. By default the value if 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
-
-
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
-- 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:
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:
-
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:
-
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
-
getOriginalDocuments
This method returns the signed document(s) without their signature(s)- Parameters:
advancedSignature
-AdvancedSignature
to find signer documents for
-
prepareSignatureValidationContext
void prepareSignatureValidationContext(ValidationContext validationContext, List<AdvancedSignature> allSignatures)Prepares thevalidationContext
for signature validation process and returns a list of signatures to validate- Parameters:
validationContext
-ValidationContext
allSignatures
- a list of allAdvancedSignature
s to be validated
-
prepareDetachedTimestampValidationContext
void prepareDetachedTimestampValidationContext(ValidationContext validationContext, List<TimestampToken> timestamps)Prepares thevalidationContext
for a timestamp validation process- Parameters:
validationContext
-ValidationContext
timestamps
- a list of detached timestamps
-
processSignaturesValidation
This method process the signature validation on the givenallSignatureList
- Parameters:
allSignatureList
- list ofAdvancedSignature
s to be validated
-
findSignatureScopes
-