Package com.unboundid.util.ssl
Class JVMDefaultTrustManager
java.lang.Object
com.unboundid.util.ssl.JVMDefaultTrustManager
- All Implemented Interfaces:
Serializable,TrustManager,X509TrustManager
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class JVMDefaultTrustManager
extends Object
implements X509TrustManager, Serializable
This class provides an implementation of a trust manager that relies on the
JVM's default set of trusted issuers.
This implementation will first look for the trust store in the following locations within the Java installation, in the following order:
This implementation will first look for the trust store in the following locations within the Java installation, in the following order:
lib/security/jssecacertsjre/lib/security/jssecacertslib/security/cacertsjre/lib/security/cacerts
jssecacerts or
cacerts file below the Java home directory.- 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.Retrieves the path to the the file containing the JVM's default set of trusted issuers.static JVMDefaultTrustManagerRetrieves the singleton instance of this trust manager.Retrieves the certificates included in this trust manager.
-
Method Details
-
getInstance
Retrieves the singleton instance of this trust manager.- Returns:
- The singleton instance of this trust manager.
-
getCACertsFile
Retrieves the path to the the file containing the JVM's default set of trusted issuers.- Returns:
- The path to the file containing the JVM's default set of trusted issuers.
- Throws:
CertificateException- If a problem was encountered while initializing this trust manager.
-
getTrustedIssuerCertificates
@NotNull public Collection<X509Certificate> getTrustedIssuerCertificates() throws CertificateExceptionRetrieves the certificates included in this trust manager.- Returns:
- The certificates included in this trust manager.
- Throws:
CertificateException- If a problem was encountered while initializing this trust manager.
-
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.- Specified by:
getAcceptedIssuersin interfaceX509TrustManager- Returns:
- The accepted issuer certificates for this trust manager, or an empty set of accepted issuers if a problem was encountered while initializing this trust manager.
-