java.lang.Object
org.newsclub.net.unix.ssl.FilterX509TrustManager
- All Implemented Interfaces:
TrustManager
,X509TrustManager
- Direct Known Subclasses:
ValidatingX509TrustManager
An
X509TrustManager
that may intercept CertificateException
s.- Author:
- Christian Kohlschütter
-
Constructor Summary
ModifierConstructorDescriptionprotected
FilterX509TrustManager
(X509TrustManager wrapped) Constructs this instance with the given wrappedX509TrustManager
. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
checkClientTrusted
(X509Certificate[] chain, String authType) final void
checkServerTrusted
(X509Certificate[] chain, String authType) protected abstract void
onCertificateException
(boolean checkClient, CertificateException e, X509Certificate[] chain, String authType) Called whenever the wrappedX509TrustManager
throws an exception when checking client or server certificate chains.protected abstract void
onCertificateTrusted
(boolean checkClient, X509Certificate[] chain, String authType) Called whenever the wrappedX509TrustManager
trusted a given client or server certificate chains.
-
Constructor Details
-
FilterX509TrustManager
Constructs this instance with the given wrappedX509TrustManager
.- Parameters:
wrapped
- Thw wrapped instance.
-
-
Method Details
-
checkClientTrusted
public final void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException - Specified by:
checkClientTrusted
in interfaceX509TrustManager
- Throws:
CertificateException
-
checkServerTrusted
public final void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException - Specified by:
checkServerTrusted
in interfaceX509TrustManager
- Throws:
CertificateException
-
getAcceptedIssuers
- Specified by:
getAcceptedIssuers
in interfaceX509TrustManager
-
onCertificateException
protected abstract void onCertificateException(boolean checkClient, CertificateException e, X509Certificate[] chain, String authType) throws CertificateException Called whenever the wrappedX509TrustManager
throws an exception when checking client or server certificate chains.- Parameters:
checkClient
- Iftrue
, we're checking a client certificate chain, iffalse
a server's.e
- The caught exceptionchain
- The (potentially partial) certificate chainauthType
- The authType.- Throws:
CertificateException
- if desired.
-
onCertificateTrusted
protected abstract void onCertificateTrusted(boolean checkClient, X509Certificate[] chain, String authType) throws CertificateException Called whenever the wrappedX509TrustManager
trusted a given client or server certificate chains.- Parameters:
checkClient
- Iftrue
, we're checking a client certificate chain, iffalse
a server's.chain
- The (potentially partial) certificate chainauthType
- The authType.- Throws:
CertificateException
- if desired.
-