public final class TrustManagerUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
TrustManagerUtils.TrustManager |
Modifier and Type | Field and Description |
---|---|
private static javax.net.ssl.X509TrustManager |
ACCEPT_ALL |
private static javax.net.ssl.X509TrustManager |
CHECK_SERVER_VALIDITY |
private static java.security.cert.X509Certificate[] |
EMPTY_X509CERTIFICATE_ARRAY |
Constructor and Description |
---|
TrustManagerUtils() |
Modifier and Type | Method and Description |
---|---|
static javax.net.ssl.X509TrustManager |
getAcceptAllTrustManager()
Generate a TrustManager that performs no checks.
|
static javax.net.ssl.X509TrustManager |
getDefaultTrustManager(java.security.KeyStore keyStore)
Return the default TrustManager provided by the JVM.
|
static javax.net.ssl.X509TrustManager |
getValidateServerCertificateTrustManager()
Generate a TrustManager that checks server certificates for validity,
but otherwise performs no checks.
|
private static final java.security.cert.X509Certificate[] EMPTY_X509CERTIFICATE_ARRAY
private static final javax.net.ssl.X509TrustManager ACCEPT_ALL
private static final javax.net.ssl.X509TrustManager CHECK_SERVER_VALIDITY
public static javax.net.ssl.X509TrustManager getAcceptAllTrustManager()
public static javax.net.ssl.X509TrustManager getValidateServerCertificateTrustManager()
public static javax.net.ssl.X509TrustManager getDefaultTrustManager(java.security.KeyStore keyStore) throws java.security.GeneralSecurityException
This should be the same as the default used by
SSLContext#init(KeyManager[], TrustManager[], SecureRandom)
when the TrustManager parameter is set to null
keyStore
- the KeyStore to use, may be null
java.security.GeneralSecurityException
- if an error occurs