java.lang.Object
eu.europa.esig.dss.validation.SignedDocumentValidator
- All Implemented Interfaces:
DocumentValidator,ProcessExecutorProvider<eu.europa.esig.dss.validation.executor.DocumentProcessExecutor>
- Direct Known Subclasses:
DetachedTimestampValidator,EvidenceRecordValidator
Validates a signed document. The content of the document is determined
automatically. It can be: XML, CAdES(p7m), PDF or ASiC(zip).
SignatureScopeFinder can be set using the appropriate setter (ex.
setCadesSignatureScopeFinder). By default, this class will use the default
SignatureScopeFinder as defined by
eu.europa.esig.dss.validation.scope.SignatureScopeFinderFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CertificateVerifierThe reference to the certificate verifier.protected List<eu.europa.esig.dss.model.DSSDocument> In case of an ASiC signature thisListof container documents.protected List<eu.europa.esig.dss.model.DSSDocument> In case of a detached signature thisListcontains the signed documents.protected List<eu.europa.esig.dss.model.DSSDocument> Contains a list of evidence record documents detached from the signatureprotected eu.europa.esig.dss.model.DSSDocumentThe document to be validated (with the signature(s) or timestamp(s))protected eu.europa.esig.dss.model.ManifestFileA relatedManifestFileto the provideddocumentprotected eu.europa.esig.dss.validation.executor.DocumentProcessExecutorThis variable can hold a specificDocumentProcessExecutorprotected eu.europa.esig.dss.spi.x509.CertificateSourceCertificate source to find signing certificateprotected booleanDefines if the validation context processing shall be skipped (Disable certificate chain building, revocation data collection,...) Default: false -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedThe constructor with a nullsignatureScopeFinderprotectedSignedDocumentValidator(SignatureScopeFinder<?> signatureScopeFinder) Deprecated.since DSS 5.13. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddReference(eu.europa.esig.dss.model.scope.SignatureScope signatureScope) Checks if the signature scope shall be added as a timestamped reference NOTE: used to avoid duplicates in ASiC with CAdES validator, due to covered signature/timestamp filesprotected voidappendCounterSignatures(List<AdvancedSignature> allSignatureList, AdvancedSignature signature) The util method to link counter signatures with the related master signaturesprotected voidappendExternalEvidenceRecords(List<AdvancedSignature> allSignatureList) Appends detached evidence record provided to the validator to the corresponding signatures covering by the evidence record documentprotected voidChecks if the Validator configuration is validprotected List<EvidenceRecord> Builds a list of detachedEvidenceRecords extracted from the documentprotected List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> Builds a list of detachedTimestampTokens extracted from the documentprotected EvidenceRecordbuildEvidenceRecord(eu.europa.esig.dss.model.DSSDocument evidenceRecordDocument) Builds an evidence record from the givenDSSDocumentprotected List<AdvancedSignature> This method build a list of signatures to be extracted from a documentprotected booleancoversSignature(AdvancedSignature signature, EvidenceRecord evidenceRecord) Verifies whether anevidenceRecordcovers thesignatureprotected DiagnosticDataBuildercreateDiagnosticDataBuilder(ValidationContext validationContext, List<AdvancedSignature> signatures) Deprecated.since DSS 5.13.protected DiagnosticDataBuildercreateDiagnosticDataBuilder(ValidationContext validationContext, List<AdvancedSignature> signatures, List<EvidenceRecord> detachedEvidenceRecords) Creates and fills theDiagnosticDataBuilderwith a relevant data<T extends AdvancedSignature>
voidfindSignatureScopes(Collection<T> currentValidatorSignatures) Deprecated.static SignedDocumentValidatorfromDocument(eu.europa.esig.dss.model.DSSDocument dssDocument) This method guesses the document format and returns an appropriate document validator.protected List<AdvancedSignature> Returns a list of all signatures from the validating documentprotected eu.europa.esig.dss.enumerations.DigestAlgorithmReturns a default digest algorithm defined for a digest calculationeu.europa.esig.dss.validation.executor.DocumentProcessExecutorReturns a default for a validator process executorRetrieves the detached evidence records found in the documentList<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> Retrieves the detached timestamps found in the documentfinal eu.europa.esig.dss.diagnostic.jaxb.XmlDiagnosticDataThis method retrievesXmlDiagnosticDatacontaining all information relevant for the validation process, including the certificate and revocation tokens obtained from online resources, e.g.protected EvidenceRecordgetEvidenceRecord(EvidenceRecordValidator evidenceRecordValidator) Gets an evidence record from aevidenceRecordValidatorprotected List<eu.europa.esig.dss.model.scope.SignatureScope> getEvidenceRecordScopes(EvidenceRecord evidenceRecord) Finds evidence record scopesList<eu.europa.esig.dss.model.DSSDocument> getOriginalDocuments(String signatureId) This method returns the signed document(s) without their signature(s)getSignatureById(String signatureId) Returns the signature with the given id.protected SignaturePolicyProviderReturns a signaturePolicyProvider If not defined, returns a default providerReturns an instance of a corresponding to the formatSignaturePolicyValidatorLoaderRetrieves the signatures found in the documentprotected List<eu.europa.esig.dss.spi.x509.tsp.TimestampedReference> getTimestampedReferences(List<eu.europa.esig.dss.model.scope.SignatureScope> signatureScopes) Returns a list of timestamped references from the given list ofSignatureScopesprotected eu.europa.esig.dss.model.identifier.TokenIdentifierProviderGetsTokenIdentifierProvider<T extends AdvancedSignature>
ValidationDataContainergetValidationData(Collection<T> signatures) Extracts a validation data for provided collection of signatures<T extends AdvancedSignature>
ValidationDataContainergetValidationData(Collection<T> signatures, Collection<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> detachedTimestamps) Extracts a validation data for provided collection of signatures and/or timestampsprotected DateReturns validation time In case if the validation time is not provided, initialize the current time value from the systemprotected SignedDocumentDiagnosticDataBuilderInitializes a relevantDiagnosticDataBuilderfor the given implementationprotected ValidationDataContainerCreates a new instance ofValidationDataContainerabstract booleanisSupported(eu.europa.esig.dss.model.DSSDocument dssDocument) Checks if the document is supported by the current validatorprotected voidprepareDetachedEvidenceRecordValidationContext(ValidationContext validationContext, Collection<EvidenceRecord> evidenceRecords) Prepares thevalidationContextfor the evidence record validation processprotected voidprepareDetachedTimestampValidationContext(ValidationContext validationContext, Collection<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> timestamps) Prepares thevalidationContextfor a timestamp validation processprotected DiagnosticDataBuilderCreates aDiagnosticDataBuilderprotected <T extends AdvancedSignature>
voidprepareSignatureForVerification(ValidationContext validationContext, Collection<T> allSignatureList) This method prepares aSignatureValidationContextfor signatures validationprotected <T extends AdvancedSignature>
voidprepareSignatureValidationContext(ValidationContext validationContext, Collection<T> allSignatures) Prepares thevalidationContextfor signature validation processprotected <T extends AdvancedSignature>
ValidationContextprepareValidationContext(Collection<T> signatures, Collection<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> detachedTimestamps, CertificateVerifier certificateVerifier) Deprecated.since DSS 5.13.protected <T extends AdvancedSignature>
ValidationContextprepareValidationContext(Collection<T> signatures, Collection<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> detachedTimestamps, Collection<EvidenceRecord> detachedEvidenceRecords, CertificateVerifier certificateVerifier) Initializes and fillsValidationContextwith necessary data sources<T extends AdvancedSignature>
voidprocessSignaturesValidation(Collection<T> allSignatureList) This method process the signature validation on the givenallSignatureListprotected final eu.europa.esig.dss.validation.reports.ReportsprocessValidationPolicy(eu.europa.esig.dss.diagnostic.jaxb.XmlDiagnosticData diagnosticData, eu.europa.esig.dss.policy.ValidationPolicy validationPolicy) Executes the validation regarding the givenvalidationPolicyprotected eu.europa.esig.dss.validation.executor.DocumentProcessExecutorThis method returns the process executor.voidsetCertificateVerifier(CertificateVerifier certificateVerifier) To carry out the validation process of the signature(s) some external sources of certificates and of revocation data can be needed.voidsetContainerContents(List<eu.europa.esig.dss.model.DSSDocument> containerContents) Sets theListofDSSDocumentcontaining the original container content for ASiC-S signatures.voidsetDetachedContents(List<eu.europa.esig.dss.model.DSSDocument> detachedContents) Sets theListofDSSDocumentcontaining the original contents to sign, for detached signature scenarios.voidsetDetachedEvidenceRecordDocuments(List<eu.europa.esig.dss.model.DSSDocument> detachedEvidenceRecordDocuments) Sets aListofDSSDocumentcontaining the evidence record documents covering the signature document.voidsetEnableEtsiValidationReport(boolean enableEtsiValidationReport) This method allows to specify if the ETSI Validation Report must be generated.voidsetIncludeSemantics(boolean include) This method allows to enable/disable the semantics inclusion in the reports (Indication / SubIndication meanings) Disabled by defaultvoidSets Locale for report messages generationvoidsetManifestFile(eu.europa.esig.dss.model.ManifestFile manifestFile) Sets a relatedManifestFileto the document to be validated.voidsetProcessExecutor(eu.europa.esig.dss.validation.executor.DocumentProcessExecutor processExecutor) This method provides the possibility to set the specificCustomProcessExecutorvoidsetSignaturePolicyProvider(SignaturePolicyProvider signaturePolicyProvider) This method allows to set a provider for Signature policiesvoidsetSigningCertificateSource(eu.europa.esig.dss.spi.x509.CertificateSource signingCertificateSource) Set a certificate source which allows to find the signing certificate by kid or certificate's digestvoidsetSkipValidationContextExecution(boolean skipValidationContextExecution) Sets if the validation context execution shall be skipped (skips certificate chain building, revocation requests, ...)voidsetTokenExtractionStrategy(eu.europa.esig.dss.enumerations.TokenExtractionStrategy tokenExtractionStrategy) This method allows to set the token extraction strategy to follow in the diagnostic data generation.voidsetTokenIdentifierProvider(eu.europa.esig.dss.model.identifier.TokenIdentifierProvider tokenIdentifierProvider) Sets the TokenIdentifierProvidervoidsetValidationLevel(eu.europa.esig.dss.validation.executor.ValidationLevel validationLevel) This method allows to specify the validation level (Basic / Timestamp / Long Term / Archival).voidsetValidationTime(Date validationTime) Allows to define a custom validation timeprotected voidvalidateContext(ValidationContext validationContext) Process the validationeu.europa.esig.dss.validation.reports.ReportsValidates the document and all its signatures.eu.europa.esig.dss.validation.reports.ReportsvalidateDocument(eu.europa.esig.dss.model.DSSDocument policyDocument) Validates the document and all its signatures.eu.europa.esig.dss.validation.reports.ReportsvalidateDocument(eu.europa.esig.dss.policy.jaxb.ConstraintsParameters validationPolicyJaxb) Validates the document and all its signatures.eu.europa.esig.dss.validation.reports.ReportsvalidateDocument(eu.europa.esig.dss.policy.ValidationPolicy validationPolicy) Validates the document and all its signatures.eu.europa.esig.dss.validation.reports.ReportsvalidateDocument(File policyFile) Validates the document and all its signatures.eu.europa.esig.dss.validation.reports.ReportsvalidateDocument(InputStream policyDataStream) Validates the document and all its signatures.eu.europa.esig.dss.validation.reports.ReportsvalidateDocument(String policyResourcePath) Validates the document and all its signatures.eu.europa.esig.dss.validation.reports.ReportsvalidateDocument(URL validationPolicyURL) Validates the document and all its signatures.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.europa.esig.dss.validation.DocumentValidator
getOriginalDocuments
-
Field Details
-
processExecutor
protected eu.europa.esig.dss.validation.executor.DocumentProcessExecutor processExecutorThis variable can hold a specificDocumentProcessExecutor -
document
protected eu.europa.esig.dss.model.DSSDocument documentThe document to be validated (with the signature(s) or timestamp(s)) -
detachedContents
In case of a detached signature thisListcontains the signed documents. -
detachedEvidenceRecordDocuments
Contains a list of evidence record documents detached from the signature -
containerContents
In case of an ASiC signature thisListof container documents. -
manifestFile
protected eu.europa.esig.dss.model.ManifestFile manifestFileA relatedManifestFileto the provideddocument -
signingCertificateSource
protected eu.europa.esig.dss.spi.x509.CertificateSource signingCertificateSourceCertificate source to find signing certificate -
certificateVerifier
The reference to the certificate verifier. The current DSS implementation proposesCommonCertificateVerifier. This verifier encapsulates the references to different sources used in the signature validation process. -
skipValidationContextExecution
protected boolean skipValidationContextExecutionDefines if the validation context processing shall be skipped (Disable certificate chain building, revocation data collection,...) Default: false
-
-
Constructor Details
-
SignedDocumentValidator
protected SignedDocumentValidator()The constructor with a nullsignatureScopeFinder -
SignedDocumentValidator
Deprecated.since DSS 5.13.The default constructor- Parameters:
signatureScopeFinder-SignatureScopeFinder
-
-
Method Details
-
fromDocument
public static SignedDocumentValidator fromDocument(eu.europa.esig.dss.model.DSSDocument dssDocument) This method guesses the document format and returns an appropriate document validator.- Parameters:
dssDocument- The instance ofDSSDocumentto validate- Returns:
- returns the specific instance of SignedDocumentValidator in terms of the document type
-
isSupported
public abstract boolean isSupported(eu.europa.esig.dss.model.DSSDocument dssDocument) Checks if the document is supported by the current validator- Parameters:
dssDocument-DSSDocumentto check- Returns:
- TRUE if the document is supported, FALSE otherwise
-
setSigningCertificateSource
public void setSigningCertificateSource(eu.europa.esig.dss.spi.x509.CertificateSource signingCertificateSource) Description copied from interface:DocumentValidatorSet a certificate source which allows to find the signing certificate by kid or certificate's digest- Specified by:
setSigningCertificateSourcein interfaceDocumentValidator- Parameters:
signingCertificateSource- the certificate source
-
setCertificateVerifier
To carry out the validation process of the signature(s) some external sources of certificates and of revocation data can be needed. The certificate verifier is used to pass these values. Note that once this setter is called any change in the content of theCommonTrustedCertificateSourceor in adjunct certificate source is not taken into account.- Specified by:
setCertificateVerifierin interfaceDocumentValidator- Parameters:
certificateVerifier-CertificateVerifier
-
setTokenExtractionStrategy
public void setTokenExtractionStrategy(eu.europa.esig.dss.enumerations.TokenExtractionStrategy tokenExtractionStrategy) Description copied from interface:DocumentValidatorThis method allows to set the token extraction strategy to follow in the diagnostic data generation.- Specified by:
setTokenExtractionStrategyin interfaceDocumentValidator- Parameters:
tokenExtractionStrategy- theTokenExtractionStrategy
-
getTokenIdentifierProvider
protected eu.europa.esig.dss.model.identifier.TokenIdentifierProvider getTokenIdentifierProvider()GetsTokenIdentifierProvider- Returns:
TokenIdentifierProvider
-
setTokenIdentifierProvider
public void setTokenIdentifierProvider(eu.europa.esig.dss.model.identifier.TokenIdentifierProvider tokenIdentifierProvider) Description copied from interface:DocumentValidatorSets the TokenIdentifierProvider- Specified by:
setTokenIdentifierProviderin interfaceDocumentValidator- Parameters:
tokenIdentifierProvider-TokenIdentifierProvider
-
setIncludeSemantics
public void setIncludeSemantics(boolean include) Description copied from interface:DocumentValidatorThis method allows to enable/disable the semantics inclusion in the reports (Indication / SubIndication meanings) Disabled by default- Specified by:
setIncludeSemanticsin interfaceDocumentValidator- Parameters:
include- true to enable the inclusion of the semantics
-
setDetachedContents
Description copied from interface:DocumentValidatorSets theListofDSSDocumentcontaining the original contents to sign, for detached signature scenarios.- Specified by:
setDetachedContentsin interfaceDocumentValidator- Parameters:
detachedContents- theListofDSSDocumentto set
-
setDetachedEvidenceRecordDocuments
public void setDetachedEvidenceRecordDocuments(List<eu.europa.esig.dss.model.DSSDocument> detachedEvidenceRecordDocuments) Description copied from interface:DocumentValidatorSets aListofDSSDocumentcontaining the evidence record documents covering the signature document.- Specified by:
setDetachedEvidenceRecordDocumentsin interfaceDocumentValidator- Parameters:
detachedEvidenceRecordDocuments- theListofDSSDocumentto set
-
setContainerContents
Description copied from interface:DocumentValidatorSets theListofDSSDocumentcontaining the original container content for ASiC-S signatures.- Specified by:
setContainerContentsin interfaceDocumentValidator- Parameters:
containerContents- theListofDSSDocumentto set
-
setManifestFile
public void setManifestFile(eu.europa.esig.dss.model.ManifestFile manifestFile) Description copied from interface:DocumentValidatorSets a relatedManifestFileto the document to be validated.- Specified by:
setManifestFilein interfaceDocumentValidator- Parameters:
manifestFile- aManifestFileto set
-
getDefaultDigestAlgorithm
protected eu.europa.esig.dss.enumerations.DigestAlgorithm getDefaultDigestAlgorithm()Returns a default digest algorithm defined for a digest calculation- Returns:
DigestAlgorithm
-
setValidationTime
Allows to define a custom validation time- Specified by:
setValidationTimein interfaceDocumentValidator- Parameters:
validationTime-Date
-
getValidationTime
Returns validation time In case if the validation time is not provided, initialize the current time value from the system- Returns:
Datevalidation time
-
setValidationLevel
public void setValidationLevel(eu.europa.esig.dss.validation.executor.ValidationLevel validationLevel) Description copied from interface:DocumentValidatorThis method allows to specify the validation level (Basic / Timestamp / Long Term / Archival). By default, the selected validation is ARCHIVAL- Specified by:
setValidationLevelin interfaceDocumentValidator- Parameters:
validationLevel-ValidationLevel
-
setEnableEtsiValidationReport
public void setEnableEtsiValidationReport(boolean enableEtsiValidationReport) Description copied from interface:DocumentValidatorThis method allows to specify if the ETSI Validation Report must be generated. Default : TRUE (the ETSI Validation report will be generated).- Specified by:
setEnableEtsiValidationReportin interfaceDocumentValidator- Parameters:
enableEtsiValidationReport- - TRUE if the report must be generated, FALSE otherwise
-
validateDocument
public eu.europa.esig.dss.validation.reports.Reports validateDocument()Description copied from interface:DocumentValidatorValidates the document and all its signatures. The default constraint file is used.- Specified by:
validateDocumentin interfaceDocumentValidator- Returns:
Reports: diagnostic data, detailed report and simple report
-
validateDocument
Description copied from interface:DocumentValidatorValidates 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.- Specified by:
validateDocumentin interfaceDocumentValidator- Parameters:
validationPolicyURL-URL- Returns:
Reports: diagnostic data, detailed report and simple report
-
validateDocument
Description copied from interface:DocumentValidatorValidates the document and all its signatures. The policyResourcePath specifies the constraint file. If null or empty the default file is used.- Specified by:
validateDocumentin interfaceDocumentValidator- Parameters:
policyResourcePath- is located against the classpath (getClass().getResourceAsStream), and NOT the filesystem- Returns:
Reports: diagnostic data, detailed report and simple report
-
validateDocument
Description copied from interface:DocumentValidatorValidates the document and all its signatures. TheFileparameter specifies the constraint file. If null or empty the default file is used.- Specified by:
validateDocumentin interfaceDocumentValidator- Parameters:
policyFile- contains the validation policy (xml) asFile- Returns:
Reports: diagnostic data, detailed report and simple report
-
validateDocument
public eu.europa.esig.dss.validation.reports.Reports validateDocument(eu.europa.esig.dss.model.DSSDocument policyDocument) Description copied from interface:DocumentValidatorValidates the document and all its signatures. The policyDataStream contains the constraint file. If null or empty the default file is used.- Specified by:
validateDocumentin interfaceDocumentValidator- 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.- Specified by:
validateDocumentin interfaceDocumentValidator- Parameters:
policyDataStream- theInputStreamwith the validation policy- Returns:
- the validation reports
-
validateDocument
public eu.europa.esig.dss.validation.reports.Reports validateDocument(eu.europa.esig.dss.policy.jaxb.ConstraintsParameters validationPolicyJaxb) Validates the document and all its signatures. ThevalidationPolicyDomcontains the constraint file. If null or empty the default file is used.- Specified by:
validateDocumentin interfaceDocumentValidator- Parameters:
validationPolicyJaxb- theConstraintsParametersto use in the validation process- Returns:
- the validation reports
-
validateDocument
public eu.europa.esig.dss.validation.reports.Reports validateDocument(eu.europa.esig.dss.policy.ValidationPolicy validationPolicy) Validates the document and all its signatures. ThevalidationPolicyDomcontains the constraint file. If null or empty the default file is used.- Specified by:
validateDocumentin interfaceDocumentValidator- Parameters:
validationPolicy- theValidationPolicyto use in the validation process- Returns:
- the validation reports
-
assertConfigurationValid
protected void assertConfigurationValid()Checks if the Validator configuration is valid -
getDiagnosticData
public final eu.europa.esig.dss.diagnostic.jaxb.XmlDiagnosticData getDiagnosticData()This method retrievesXmlDiagnosticDatacontaining all information relevant for the validation process, including the certificate and revocation tokens obtained from online resources, e.g. AIA, CRL, OCSP (when applicable).- Returns:
XmlDiagnosticData
-
prepareDiagnosticDataBuilder
Creates aDiagnosticDataBuilder- Returns:
DiagnosticDataBuilder
-
prepareValidationContext
@Deprecated protected <T extends AdvancedSignature> ValidationContext prepareValidationContext(Collection<T> signatures, Collection<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> detachedTimestamps, CertificateVerifier certificateVerifier) Deprecated.since DSS 5.13. Use#prepareValidationContext(signatures, detachedTimestamps, detachedEvidenceRecords, certificateVerifier}Initializes and fillsValidationContextwith necessary data sources- Type Parameters:
T-AdvancedSignatureimplementation- Parameters:
signatures- a collection ofAdvancedSignaturesdetachedTimestamps- a collection of detachedTimestampTokenscertificateVerifier-CertificateVerifierto be used for the validation- Returns:
ValidationContext
-
prepareValidationContext
protected <T extends AdvancedSignature> ValidationContext prepareValidationContext(Collection<T> signatures, Collection<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> detachedTimestamps, Collection<EvidenceRecord> detachedEvidenceRecords, CertificateVerifier certificateVerifier) Initializes and fillsValidationContextwith necessary data sources- 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
-
initializeDiagnosticDataBuilder
Initializes a relevantDiagnosticDataBuilderfor the given implementation- Returns:
SignedDocumentDiagnosticDataBuilder
-
getValidationData
public <T extends AdvancedSignature> ValidationDataContainer getValidationData(Collection<T> signatures) Description copied from interface:DocumentValidatorExtracts a validation data for provided collection of signatures- Specified by:
getValidationDatain interfaceDocumentValidator- Type Parameters:
T-AdvancedSignatureimplementation- Parameters:
signatures- a collection ofAdvancedSignatures- Returns:
ValidationDataContainer
-
getValidationData
public <T extends AdvancedSignature> ValidationDataContainer getValidationData(Collection<T> signatures, Collection<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> detachedTimestamps) Description copied from interface:DocumentValidatorExtracts a validation data for provided collection of signatures and/or timestamps- Specified by:
getValidationDatain interfaceDocumentValidator- Type Parameters:
T-AdvancedSignatureimplementation- Parameters:
signatures- a collection ofAdvancedSignaturesdetachedTimestamps- a collection of detachedTimestampTokens- Returns:
ValidationDataContainer
-
instantiateValidationDataContainer
Creates a new instance ofValidationDataContainer- Returns:
ValidationDataContainer
-
createDiagnosticDataBuilder
@Deprecated protected DiagnosticDataBuilder createDiagnosticDataBuilder(ValidationContext validationContext, List<AdvancedSignature> signatures) Deprecated.since DSS 5.13. Use#createDiagnosticDataBuilder(validationContext, signatures, evidenceRecords)Creates and fills theDiagnosticDataBuilderwith a relevant data- Parameters:
validationContext-ValidationContextused for the validationsignatures- a list ofAdvancedSignatures to be validated- Returns:
- filled
DiagnosticDataBuilder
-
createDiagnosticDataBuilder
protected DiagnosticDataBuilder createDiagnosticDataBuilder(ValidationContext validationContext, List<AdvancedSignature> signatures, List<EvidenceRecord> detachedEvidenceRecords) Creates and fills theDiagnosticDataBuilderwith a relevant data- Parameters:
validationContext-ValidationContextused for the validationsignatures- a list ofAdvancedSignatures to be validateddetachedEvidenceRecords- a list of detachedEvidenceRecords to be validated- Returns:
- filled
DiagnosticDataBuilder
-
prepareSignatureValidationContext
protected <T extends AdvancedSignature> void prepareSignatureValidationContext(ValidationContext validationContext, Collection<T> allSignatures) Prepares thevalidationContextfor signature validation process- Type Parameters:
T-AdvancedSignatureimplementation- Parameters:
validationContext-ValidationContextallSignatures- a collection of allAdvancedSignatures to be validated
-
prepareSignatureForVerification
protected <T extends AdvancedSignature> void prepareSignatureForVerification(ValidationContext validationContext, Collection<T> allSignatureList) This method prepares aSignatureValidationContextfor signatures validation- Type Parameters:
T-AdvancedSignatureimplementation- Parameters:
validationContext-ValidationContextis the implementation of the validators for: certificates, timestamps and revocation data.allSignatureList-CollectionofAdvancedSignatures to validate including the countersignatures
-
prepareDetachedTimestampValidationContext
protected void prepareDetachedTimestampValidationContext(ValidationContext validationContext, Collection<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> timestamps) Prepares thevalidationContextfor a timestamp validation process- Parameters:
validationContext-ValidationContexttimestamps- a collection of detached timestamps
-
prepareDetachedEvidenceRecordValidationContext
protected void prepareDetachedEvidenceRecordValidationContext(ValidationContext validationContext, Collection<EvidenceRecord> evidenceRecords) Prepares thevalidationContextfor the evidence record validation process- Parameters:
validationContext-ValidationContextevidenceRecords- a collection of detached evidence records
-
validateContext
Process the validation- Parameters:
validationContext-ValidationContextto process
-
setSignaturePolicyProvider
Description copied from interface:DocumentValidatorThis method allows to set a provider for Signature policies- Specified by:
setSignaturePolicyProviderin interfaceDocumentValidator- Parameters:
signaturePolicyProvider-SignaturePolicyProvider
-
getSignaturePolicyProvider
Returns a signaturePolicyProvider If not defined, returns a default provider- Returns:
SignaturePolicyProvider
-
getSignaturePolicyValidatorLoader
Returns an instance of a corresponding to the formatSignaturePolicyValidatorLoader- Returns:
SignaturePolicyValidatorLoader
-
setProcessExecutor
public void setProcessExecutor(eu.europa.esig.dss.validation.executor.DocumentProcessExecutor processExecutor) Description copied from interface:ProcessExecutorProviderThis method provides the possibility to set the specificCustomProcessExecutor- Specified by:
setProcessExecutorin interfaceProcessExecutorProvider<eu.europa.esig.dss.validation.executor.DocumentProcessExecutor>- Parameters:
processExecutor-ProcessExecutor
-
provideProcessExecutorInstance
protected eu.europa.esig.dss.validation.executor.DocumentProcessExecutor provideProcessExecutorInstance()This method returns the process executor. If the instance of this class is not yet instantiated then the new instance is created.- Returns:
SignatureProcessExecutor
-
getDefaultProcessExecutor
public eu.europa.esig.dss.validation.executor.DocumentProcessExecutor getDefaultProcessExecutor()Description copied from interface:ProcessExecutorProviderReturns a default for a validator process executor- Specified by:
getDefaultProcessExecutorin interfaceProcessExecutorProvider<eu.europa.esig.dss.validation.executor.DocumentProcessExecutor>- Returns:
- Process Executor
-
processValidationPolicy
protected final eu.europa.esig.dss.validation.reports.Reports processValidationPolicy(eu.europa.esig.dss.diagnostic.jaxb.XmlDiagnosticData diagnosticData, eu.europa.esig.dss.policy.ValidationPolicy validationPolicy) Executes the validation regarding the givenvalidationPolicy- Parameters:
diagnosticData-DiagnosticDatacontained a data to be validatedvalidationPolicy-ValidationPolicy- Returns:
- validation
Reports
-
getAllSignatures
Returns a list of all signatures from the validating document- Returns:
- a list of
AdvancedSignatures
-
appendCounterSignatures
protected void appendCounterSignatures(List<AdvancedSignature> allSignatureList, AdvancedSignature signature) The util method to link counter signatures with the related master signatures- Parameters:
allSignatureList- a list ofAdvancedSignaturessignature- currentAdvancedSignature
-
appendExternalEvidenceRecords
Appends detached evidence record provided to the validator to the corresponding signatures covering by the evidence record document- Parameters:
allSignatureList- a list ofAdvancedSignatures
-
coversSignature
Verifies whether anevidenceRecordcovers thesignature- Parameters:
signature-AdvancedSignatureevidenceRecord-EvidenceRecord- Returns:
- TRUE if the evidence record covers the signature file, FALSE otherwise
-
getSignatures
Description copied from interface:DocumentValidatorRetrieves the signatures found in the document- Specified by:
getSignaturesin interfaceDocumentValidator- Returns:
- a list of AdvancedSignatures for validation purposes
-
buildSignatures
This method build a list of signatures to be extracted from a document- Returns:
- a list of
AdvancedSignatures
-
getDetachedTimestamps
Description copied from interface:DocumentValidatorRetrieves the detached timestamps found in the document- Specified by:
getDetachedTimestampsin interfaceDocumentValidator- Returns:
- a list of TimestampToken for validation purposes
-
buildDetachedTimestamps
Builds a list of detachedTimestampTokens extracted from the document- Returns:
- a list of
TimestampTokens
-
getDetachedEvidenceRecords
Description copied from interface:DocumentValidatorRetrieves the detached evidence records found in the document- Specified by:
getDetachedEvidenceRecordsin interfaceDocumentValidator- Returns:
- a list of Evidence Records for validation purposes
-
buildDetachedEvidenceRecords
Builds a list of detachedEvidenceRecords extracted from the document- Returns:
- a list of
EvidenceRecords
-
buildEvidenceRecord
protected EvidenceRecord buildEvidenceRecord(eu.europa.esig.dss.model.DSSDocument evidenceRecordDocument) Builds an evidence record from the givenDSSDocument- Parameters:
evidenceRecordDocument-DSSDocumentcontaining an evidence record- Returns:
EvidenceRecord
-
getEvidenceRecord
Gets an evidence record from aevidenceRecordValidator- Parameters:
evidenceRecordValidator-EvidenceRecordValidator- Returns:
EvidenceRecord
-
getEvidenceRecordScopes
protected List<eu.europa.esig.dss.model.scope.SignatureScope> getEvidenceRecordScopes(EvidenceRecord evidenceRecord) Finds evidence record scopes- Parameters:
evidenceRecord-EvidenceRecord- Returns:
- a list of
SignatureScopes
-
processSignaturesValidation
public <T extends AdvancedSignature> void processSignaturesValidation(Collection<T> allSignatureList) Description copied from interface:DocumentValidatorThis method process the signature validation on the givenallSignatureList- Specified by:
processSignaturesValidationin interfaceDocumentValidator- Type Parameters:
T-AdvancedSignatureimplementation- Parameters:
allSignatureList- a collection ofAdvancedSignatures to be validated
-
findSignatureScopes
@Deprecated public <T extends AdvancedSignature> void findSignatureScopes(Collection<T> currentValidatorSignatures) Deprecated.Description copied from interface:DocumentValidatorFinds SignatureScopes for a list of signatures- Specified by:
findSignatureScopesin interfaceDocumentValidator- Type Parameters:
T-AdvancedSignatureimplementation- Parameters:
currentValidatorSignatures- a collection ofAdvancedSignatures
-
getTimestampedReferences
protected List<eu.europa.esig.dss.spi.x509.tsp.TimestampedReference> getTimestampedReferences(List<eu.europa.esig.dss.model.scope.SignatureScope> signatureScopes) Returns a list of timestamped references from the given list ofSignatureScopes- Parameters:
signatureScopes- a list ofSignatureScopes- Returns:
- a list of
TimestampedReferences
-
addReference
protected boolean addReference(eu.europa.esig.dss.model.scope.SignatureScope signatureScope) Checks if the signature scope shall be added as a timestamped reference NOTE: used to avoid duplicates in ASiC with CAdES validator, due to covered signature/timestamp files- Parameters:
signatureScope-SignatureScopeto check- Returns:
- TRUE if the timestamped reference shall be created for the given
SignatureScope, FALSE otherwise
-
setSkipValidationContextExecution
public void setSkipValidationContextExecution(boolean skipValidationContextExecution) Sets if the validation context execution shall be skipped (skips certificate chain building, revocation requests, ...)- Parameters:
skipValidationContextExecution- if the context validation shall be skipped
-
setLocale
Sets Locale for report messages generation- Parameters:
locale-Locale
-
getOriginalDocuments
Description copied from interface:DocumentValidatorThis method returns the signed document(s) without their signature(s)- Specified by:
getOriginalDocumentsin interfaceDocumentValidator- Parameters:
signatureId- the DSS ID of the signature to extract original signer data for- Returns:
- list of
DSSDocuments
-
getSignatureById
Returns the signature with the given id. Processes customTokenIdentifierProviderand counter signatures- Parameters:
signatureId-Stringid of a signature to be extracted- Returns:
AdvancedSignaturewith the given id if found, NULL otherwise
-