Package com.unboundid.util.ssl
Class AggregateTrustManager
java.lang.Object
com.unboundid.util.ssl.AggregateTrustManager
- All Implemented Interfaces:
TrustManager,X509TrustManager
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class AggregateTrustManager
extends Object
implements X509TrustManager
This class provides an SSL trust manager that has the ability to delegate the
determination about whether to trust a given certificate to one or more other
trust managers. It can be configured to use a logical AND (i.e., all
associated trust managers must be satisfied) or a logical OR (i.e., at least
one of the associated trust managers must be satisfied).
-
Constructor Summary
ConstructorsConstructorDescriptionAggregateTrustManager(boolean requireAllAccepted, Collection<X509TrustManager> trustManagers) Creates a new aggregate trust manager with the provided information.AggregateTrustManager(boolean requireAllAccepted, X509TrustManager... trustManagers) Creates a new aggregate trust manager with the provided information. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckClientTrusted(X509Certificate[] chain, String authType) Checks to determine whether the provided client certificate chain should be trusted.voidcheckServerTrusted(X509Certificate[] chain, String authType) Checks to determine whether the provided server certificate chain should be trusted.Retrieves the accepted issuer certificates for this trust manager.Retrieves the set of trust managers that will be used to perform the validation.booleanIndicates whether all of the associated trust managers will be required to accept a given certificate for it to be considered acceptable.
-
Constructor Details
-
AggregateTrustManager
public AggregateTrustManager(boolean requireAllAccepted, @NotNull X509TrustManager... trustManagers) Creates a new aggregate trust manager with the provided information.- Parameters:
requireAllAccepted- Indicates whether all of the associated trust managers must accept a presented certificate for it to be allowed, or just at least one of them.trustManagers- The set of trust managers to use to make the determination. It must not benullor empty.
-
AggregateTrustManager
public AggregateTrustManager(boolean requireAllAccepted, @NotNull Collection<X509TrustManager> trustManagers) Creates a new aggregate trust manager with the provided information.- Parameters:
requireAllAccepted- Indicates whether all of the associated trust managers must accept a presented certificate for it to be allowed, or just at least one of them.trustManagers- The set of trust managers to use to make the determination. It must not benullor empty.
-
-
Method Details
-
requireAllAccepted
Indicates whether all of the associated trust managers will be required to accept a given certificate for it to be considered acceptable.- Returns:
trueif all of the associated trust managers will be required to accept the provided certificate chain, orfalseif it will be acceptable for at least one trust manager to accept the chain even if one or more others do not.
-
getAssociatedTrustManagers
Retrieves the set of trust managers that will be used to perform the validation.- Returns:
- The set of trust managers that will be used to perform the validation.
-
checkClientTrusted
public void checkClientTrusted(@NotNull X509Certificate[] chain, @NotNull String authType) throws CertificateException Checks to determine whether the provided client certificate chain should be trusted.- Specified by:
checkClientTrustedin interfaceX509TrustManager- Parameters:
chain- The client certificate chain for which to make the determination.authType- The authentication type based on the client certificate.- Throws:
CertificateException- If the provided client certificate chain should not be trusted.
-
checkServerTrusted
public void checkServerTrusted(@NotNull X509Certificate[] chain, @NotNull String authType) throws CertificateException Checks to determine whether the provided server certificate chain should be trusted.- Specified by:
checkServerTrustedin interfaceX509TrustManager- Parameters:
chain- The server certificate chain for which to make the determination.authType- The key exchange algorithm used.- Throws:
CertificateException- If the provided server certificate chain should not be trusted.
-
getAcceptedIssuers
Retrieves the accepted issuer certificates for this trust manager. This will always return an empty array.- Specified by:
getAcceptedIssuersin interfaceX509TrustManager- Returns:
- The accepted issuer certificates for this trust manager.
-