Class AbstractPathValidator
java.lang.Object
se.swedenconnect.sigval.cert.chain.AbstractPathValidator
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
CertificatePathValidator
Abstract class for implementations of a certificate chain validator
This path validator is designed so that it can be used as the underlying path validator for a certificate validator
that implements the inteface of CertificateValidator
.
This is done by 2 factors:
- Any errors encountered when doing path validation results in en exception (
ExtendedCertPathValidatorException
. This is an extension ofCertPathValidatorException
used by the interface - The result (
PathValidationResult
) is an extension of the inteface resultCertificateValidationResult
Editors note: This library does however not use the CertificateValidator
interface
as this interface requires implementation of functions where a CRL is provided as input to the validation process. Such procedure
is not relevant for this path validator as it builds on the CRLCache implementation instead. To implement this interface you
need the function provided in this class in addition to code that can make use of a separately provided CRL.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CertificateValidityCheckerFactory
Provides the certificate validation checker for each instance of certificate validationprotected final CertStore
protected final List
<X509Certificate> protected final CRLCache
static final String
protected final PathBuilder
protected final X509Certificate
protected final List
<TrustAnchor> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractPathValidator
(X509Certificate targetCert, List<X509Certificate> chain, CRLCache crlCache, PathBuilder pathBuilder, List<TrustAnchor> trustAnchors, CertStore certStore, String id, PropertyChangeListener... propertyChangeListeners) Constructs the chain validator -
Method Summary
Modifier and TypeMethodDescriptionvoid
run()
Running the validation task asRunnable
task and returning result to the callback function of all property change listenersabstract PathValidationResult
Validates a certificate path
-
Field Details
-
DEFAULT_EVENT_ID
- See Also:
-
certificateValidityCheckerFactory
Provides the certificate validation checker for each instance of certificate validation -
crlCache
-
pathBuilder
-
targetCert
-
chain
-
trustAnchors
-
certStore
-
-
Constructor Details
-
AbstractPathValidator
protected AbstractPathValidator(X509Certificate targetCert, List<X509Certificate> chain, CRLCache crlCache, PathBuilder pathBuilder, List<TrustAnchor> trustAnchors, CertStore certStore, String id, PropertyChangeListener... propertyChangeListeners) Constructs the chain validator- Parameters:
targetCert
- the certificate being validatedchain
- the supporting chain of certificates which may include the target certificate and root certificatescrlCache
- CRL cache providing access to certificate revocation listspathBuilder
- path builder used to find and verify the path to a trust anchortrustAnchors
- a list of trust anchors that must be used to terminate the validated chaincertStore
- certificate store providing complementary intermediary certificatesid
- the name of the process returned to registered listenerspropertyChangeListeners
- listeners that are notified when the validation process is complete
-
-
Method Details
-
run
public void run()Running the validation task asRunnable
task and returning result to the callback function of all property change listeners -
validateCertificatePath
public abstract PathValidationResult validateCertificatePath() throws ExtendedCertPathValidatorExceptionValidates a certificate path- Returns:
PathValidationResult
- Throws:
ExtendedCertPathValidatorException
- errors encountered while validation certificate path
-