public class SSLContextUtil extends Object
SSLContext相关工具封装| Constructor and Description |
|---|
SSLContextUtil() |
| Modifier and Type | Method and Description |
|---|---|
static SSLContext |
createSSLContext(KeyManager[] keyManagers,
TrustManager[] trustManagers)
创建和初始化
SSLContext |
static SSLContext |
createSSLContext(KeyStore keyStore,
char[] password)
创建和初始化
SSLContext |
static SSLContext |
createSSLContext(String protocol,
KeyManager[] keyManagers,
TrustManager[] trustManagers)
创建和初始化
SSLContext |
static SSLContext |
createSSLContext(String protocol,
KeyManager keyManager,
TrustManager trustManager)
|
static SSLContext |
createTrustAnySSLContext()
创建
SSLContext,信任全部,协议为TLS |
static SSLContext |
createTrustAnySSLContext(String protocol)
创建
SSLContext,信任全部 |
static SSLContext |
getDefault()
获取默认的
SSLContext |
public static SSLContext getDefault()
SSLContextSSLContextpublic static SSLContext createTrustAnySSLContext() throws IORuntimeException
SSLContext,信任全部,协议为TLSSSLContextIORuntimeException - 包装 GeneralSecurityException异常public static SSLContext createTrustAnySSLContext(String protocol) throws IORuntimeException
SSLContext,信任全部protocol - SSL协议,例如TLS等,null表示默认TLSSSLContextIORuntimeException - 包装 GeneralSecurityException异常public static SSLContext createSSLContext(String protocol, KeyManager keyManager, TrustManager trustManager) throws IORuntimeException
protocol - SSL协议,例如TLS等keyManager - 密钥管理器,null表示默认trustManager - 信任管理器, null表示默认SSLContextIORuntimeException - 包装 GeneralSecurityException异常public static SSLContext createSSLContext(KeyStore keyStore, char[] password) throws IORuntimeException
SSLContextkeyStore - KeyStorepassword - 密码SSLContextIORuntimeException - 包装 GeneralSecurityException异常public static SSLContext createSSLContext(KeyManager[] keyManagers, TrustManager[] trustManagers) throws IORuntimeException
SSLContextkeyManagers - 密钥管理器,null表示默认trustManagers - 信任管理器, null表示默认SSLContextIORuntimeException - 包装 GeneralSecurityException异常public static SSLContext createSSLContext(String protocol, KeyManager[] keyManagers, TrustManager[] trustManagers) throws IORuntimeException
SSLContextprotocol - SSL协议,例如TLS等keyManagers - 密钥管理器,null表示默认trustManagers - 信任管理器, null表示默认SSLContextIORuntimeException - 包装 GeneralSecurityException异常Copyright © 2025. All rights reserved.