public class BinaryCertChainValidator extends Object implements X509CertChainValidatorExt
X509CertChainValidator
implementation which always fails or accepts certificates,
basing on the constructor argument. Useful for tests and insecure setups (e.g. SSL client that wants
SSL encryption but do not use SSL authentication).Constructor and Description |
---|
BinaryCertChainValidator(boolean acceptAll) |
Modifier and Type | Method and Description |
---|---|
void |
addUpdateListener(StoreUpdateListener listener)
Registers a listener which can react to errors found during refreshing
of the trust material: trusted CAs or CRLs.
|
void |
addValidationListener(ValidationErrorListener listener)
Registers a listener which can react to errors found during certificate
validation.
|
void |
dispose()
Disposes resources used by this Validator, like threads.
|
ProxySupport |
getProxySupport()
Returns whether this validator supports proxy certificates.
|
RevocationParameters |
getRevocationCheckingMode()
Gets the current revocation checking mode.
|
X509Certificate[] |
getTrustedIssuers()
Returns a list of trusted issuers of certificates.
|
void |
removeUpdateListener(StoreUpdateListener listener)
Unregisters a previously registered CA or CRL update listener.
|
void |
removeValidationListener(ValidationErrorListener listener)
Unregisters a previously registered validation listener.
|
ValidationResult |
validate(CertPath certPath)
Performs validation of a provided certificate path.
|
ValidationResult |
validate(X509Certificate[] certChain)
Performs validation of a provided certificate chain.
|
public BinaryCertChainValidator(boolean acceptAll)
acceptAll
- if true then all validations will succeed. If false all will fail.public ValidationResult validate(CertPath certPath)
validate
in interface X509CertChainValidator
certPath
- to be validatedpublic ValidationResult validate(X509Certificate[] certChain)
validate
in interface X509CertChainValidator
certChain
- to be validatedpublic X509Certificate[] getTrustedIssuers()
getTrustedIssuers
in interface X509CertChainValidator
public void addValidationListener(ValidationErrorListener listener)
ValidationError
, not the exception.addValidationListener
in interface X509CertChainValidator
listener
- to be registeredpublic void removeValidationListener(ValidationErrorListener listener)
removeValidationListener
in interface X509CertChainValidator
listener
- to be unregisteredpublic void addUpdateListener(StoreUpdateListener listener)
addUpdateListener
in interface X509CertChainValidator
listener
- to be registeredpublic void removeUpdateListener(StoreUpdateListener listener)
removeUpdateListener
in interface X509CertChainValidator
listener
- to be unregisteredpublic ProxySupport getProxySupport()
X509CertChainValidatorExt
getProxySupport
in interface X509CertChainValidatorExt
public RevocationParameters getRevocationCheckingMode()
X509CertChainValidatorExt
getRevocationCheckingMode
in interface X509CertChainValidatorExt
public void dispose()
X509CertChainValidatorExt
dispose
in interface X509CertChainValidatorExt
Copyright © 2012-2017 European Middleware Initiative. All Rights Reserved.