Class CompositeX509TrustManager
java.lang.Object
de.xima.fc.certificate.provider.internal.CompositeX509TrustManager
- All Implemented Interfaces:
TrustManager, X509TrustManager
Composite implementation of
X509TrustManager that delegates trust checks to a list of underlying trust
managers. A certificate chain is considered trusted if any of the provided trust managers accepts it.
This class is useful when you want to combine multiple trust sources, such as the default system trust store and a custom trust store.
- Since:
- 04.06.25
- Author:
- tobias
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeX509TrustManager(List<X509TrustManager> trustManagers) Constructs a new CompositeX509TrustManager with the given list of trust managers. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckClientTrusted(X509Certificate[] chain, String authType) Checks whether the client certificate chain is trusted by any of the underlying trust managers.voidcheckServerTrusted(X509Certificate[] chain, String authType) Checks whether the server certificate chain is trusted by any of the underlying trust managers.Returns the combined list of accepted issuers from all underlying trust managers.
-
Constructor Details
-
CompositeX509TrustManager
Constructs a new CompositeX509TrustManager with the given list of trust managers.- Parameters:
trustManagers- the list of X509TrustManagers to delegate to
-
-
Method Details
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException Checks whether the client certificate chain is trusted by any of the underlying trust managers.- Specified by:
checkClientTrustedin interfaceX509TrustManager- Parameters:
chain- the client certificate chainauthType- the authentication type based on the client certificate- Throws:
CertificateException- if none of the trust managers trusts the certificate chain
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException Checks whether the server certificate chain is trusted by any of the underlying trust managers.- Specified by:
checkServerTrustedin interfaceX509TrustManager- Parameters:
chain- the server certificate chainauthType- the key exchange algorithm used- Throws:
CertificateException- if none of the trust managers trusts the certificate chain
-
getAcceptedIssuers
Returns the combined list of accepted issuers from all underlying trust managers.- Specified by:
getAcceptedIssuersin interfaceX509TrustManager- Returns:
- an array of accepted X509Certificate issuers
-