Package eu.europa.esig.dss.validation
Class CertificateValidator
java.lang.Object
eu.europa.esig.dss.validation.CertificateValidator
- All Implemented Interfaces:
ProcessExecutorProvider<CertificateProcessExecutor>
public class CertificateValidator
extends Object
implements ProcessExecutorProvider<CertificateProcessExecutor>
Validates a CertificateToken
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Checks if the Validator configuration is validprotected DiagnosticDataBuilder
createDiagnosticDataBuilder
(ValidationContext validationContext) Creates and fills theDiagnosticDataBuilder
with a relevant datastatic CertificateValidator
fromCertificate
(CertificateToken token) Creates a CertificateValidator from a certificateTokenReturns a default for a validator process executorfinal XmlDiagnosticData
This method retrievesXmlDiagnosticData
containing all information relevant for the validation process, including the certificate and revocation tokens obtained from online resources, e.g.protected DiagnosticDataBuilder
Creates aDiagnosticDataBuilder
protected ValidationContext
prepareValidationContext
(CertificateVerifier certificateVerifier) Initializes and fillsValidationContext
for a certificate token validationGets theCertificateProcessExecutor
void
setCertificateVerifier
(CertificateVerifier certificateVerifier) Sets the CertificateVerifiervoid
Sets the Locale to use for messages in reportsvoid
setProcessExecutor
(CertificateProcessExecutor processExecutor) This method provides the possibility to set the specificCustomProcessExecutor
void
setTokenExtractionStrategy
(TokenExtractionStrategy tokenExtractionStrategy) Sets the TokenExtractionStrategyvoid
setTokenIdentifierProvider
(TokenIdentifierProvider identifierProvider) Sets the TokenIdentifierProvidervoid
setValidationTime
(Date validationTime) Sets the validationTimevalidate()
Validates the certificate with a default validation policyvalidate
(ValidationPolicy validationPolicy) Validated the certificate with a custom validation policyvalidate
(InputStream policyDataStream) This method validates a certificate with the given validation policyInputStream
-
Method Details
-
fromCertificate
Creates a CertificateValidator from a certificateToken- Parameters:
token
-CertificateToken
- Returns:
CertificateValidator
-
setCertificateVerifier
Sets the CertificateVerifier- Parameters:
certificateVerifier
-CertificateVerifier
-
setTokenExtractionStrategy
Sets the TokenExtractionStrategy- Parameters:
tokenExtractionStrategy
-TokenExtractionStrategy
-
setTokenIdentifierProvider
Sets the TokenIdentifierProvider- Parameters:
identifierProvider
-TokenIdentifierProvider
-
setValidationTime
Sets the validationTime- Parameters:
validationTime
-Date
-
setLocale
Sets the Locale to use for messages in reports- Parameters:
locale
-Locale
-
validate
Validates the certificate with a default validation policy- Returns:
CertificateReports
-
validate
This method validates a certificate with the given validation policyInputStream
- Parameters:
policyDataStream
-InputStream
representing the XML Validation Policy file- Returns:
CertificateReports
-
validate
Validated the certificate with a custom validation policy- Parameters:
validationPolicy
-ValidationPolicy
- Returns:
CertificateReports
-
assertConfigurationValid
protected void assertConfigurationValid()Checks if the Validator configuration is valid -
getDiagnosticData
This method retrievesXmlDiagnosticData
containing 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
-
prepareValidationContext
Initializes and fillsValidationContext
for a certificate token validation- Parameters:
certificateVerifier
-CertificateVerifier
to be used- Returns:
ValidationContext
-
prepareDiagnosticDataBuilder
Creates aDiagnosticDataBuilder
- Returns:
DiagnosticDataBuilder
-
createDiagnosticDataBuilder
Creates and fills theDiagnosticDataBuilder
with a relevant data- Parameters:
validationContext
-ValidationContext
used for the validation- Returns:
- filled
DiagnosticDataBuilder
-
setProcessExecutor
Description copied from interface:ProcessExecutorProvider
This method provides the possibility to set the specificCustomProcessExecutor
- Specified by:
setProcessExecutor
in interfaceProcessExecutorProvider<CertificateProcessExecutor>
- Parameters:
processExecutor
-ProcessExecutor
-
provideProcessExecutorInstance
Gets theCertificateProcessExecutor
- Returns:
CertificateProcessExecutor
-
getDefaultProcessExecutor
Description copied from interface:ProcessExecutorProvider
Returns a default for a validator process executor- Specified by:
getDefaultProcessExecutor
in interfaceProcessExecutorProvider<CertificateProcessExecutor>
- Returns:
- Process Executor
-