Package com.unboundid.util.ssl
Class NullTrustManager
java.lang.Object
com.unboundid.util.ssl.NullTrustManager
- All Implemented Interfaces:
Serializable,TrustManager,X509TrustManager
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class NullTrustManager
extends Object
implements X509TrustManager, Serializable
This class provides an SSL trust manager that will not trust any
certificates. It is primarily useful for testing purposes.
- See Also:
-
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.static NullTrustManagerRetrieves the singleton instance of this class.
-
Method Details
-
getInstance
Retrieves the singleton instance of this class.- Returns:
- The singleton instance of this class.
-
checkClientTrusted
public void checkClientTrusted(@NotNull X509Certificate[] chain, @NotNull String authType) throws CertificateException Checks to determine whether the provided client certificate chain should be trusted. A certificate will only be rejected (by throwing aCertificateException) if certificate validity dates should be examined and the certificate or any of its issuers is outside of the validity window.- 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. A certificate will only be rejected (by throwing aCertificateException) if certificate validity dates should be examined and the certificate or any of its issuers is outside of the validity window.- 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.
-