Class CertificatePathValidator
java.lang.Object
se.swedenconnect.sigval.cert.chain.AbstractPathValidator
se.swedenconnect.sigval.cert.chain.impl.CertificatePathValidator
- All Implemented Interfaces:
PropertyChangeListener,Runnable,EventListener,CertificateValidityCheckerFactory
public class CertificatePathValidator
extends AbstractPathValidator
implements PropertyChangeListener, CertificateValidityCheckerFactory
Certificate path validator implementation. This path validator can be executed as a runnable object in a designated Thread
The result is delivered to the callback function of any registered PropertyChange listeners. Alternatively, path validation
can be executed by calling the validateCertificatePath() function.
The option to set the boolean singleThreaded applies only to underlying validity checks and has nothing to do with whether this path validator itself is executed as a runnable or as a direct function call.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PKIXCertPathBuilderResultThe result of certificate path building and PKIX path validation except revocation checkingprotected static final PathBuilderprotected List<X509Certificate> The Certificate path starting with the target certificate first and ending with the trust anchor certificateprotected booleanForce the underlying validation operations to be performed in a single thread.protected List<ValidationStatus> Result list of certificate status checksFields inherited from class se.swedenconnect.sigval.cert.chain.AbstractPathValidator
certificateValidityCheckerFactory, certStore, chain, crlCache, DEFAULT_EVENT_ID, pathBuilder, targetCert, trustAnchors -
Constructor Summary
ConstructorsConstructorDescriptionCertificatePathValidator(X509Certificate targetCert, List<X509Certificate> chain, List<TrustAnchor> trustAnchors, CertStore certStore, CRLCache crlCache, PropertyChangeListener... propertyChangeListeners) Constructs the chain validator -
Method Summary
Modifier and TypeMethodDescriptiongetCertificateValidityChecker(X509Certificate certificate, X509Certificate issuer, CRLCache crlCache, PropertyChangeListener... propertyChangeListeners) voidCallback function to collect validation results from validation threadsValidates a certificate pathMethods inherited from class se.swedenconnect.sigval.cert.chain.AbstractPathValidator
run
-
Field Details
-
PATH_BUILDER
-
singleThreaded
protected boolean singleThreadedForce the underlying validation operations to be performed in a single thread. -
validationStatusList
Result list of certificate status checks -
certPathBuilderResult
The result of certificate path building and PKIX path validation except revocation checking -
pathBuilderCertPath
The Certificate path starting with the target certificate first and ending with the trust anchor certificate
-
-
Constructor Details
-
CertificatePathValidator
public CertificatePathValidator(X509Certificate targetCert, List<X509Certificate> chain, List<TrustAnchor> trustAnchors, CertStore certStore, CRLCache crlCache, 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 certificatestrustAnchors- a list of trust anchors that must be used to terminate the validated chaincertStore- certificate store providing complementary intermediary certificatescrlCache- CRL cache providing access to certificate revocation listspropertyChangeListeners- listeners that are notified when the validation process is complete
-
-
Method Details
-
validateCertificatePath
Description copied from class:AbstractPathValidatorValidates a certificate path- Specified by:
validateCertificatePathin classAbstractPathValidator- Returns:
PathValidationResult- Throws:
ExtendedCertPathValidatorException- errors encountered while validation certificate path
-
getCertificateValidityChecker
public CertificateValidityChecker getCertificateValidityChecker(X509Certificate certificate, X509Certificate issuer, CRLCache crlCache, PropertyChangeListener... propertyChangeListeners) - Specified by:
getCertificateValidityCheckerin interfaceCertificateValidityCheckerFactory
-
propertyChange
Callback function to collect validation results from validation threads- Specified by:
propertyChangein interfacePropertyChangeListener- Parameters:
evt- event holding validation result data
-