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()
SSLContext
SSLContext
public static SSLContext createTrustAnySSLContext() throws IORuntimeException
SSLContext
,信任全部,协议为TLSSSLContext
IORuntimeException
- 包装 GeneralSecurityException异常public static SSLContext createTrustAnySSLContext(String protocol) throws IORuntimeException
SSLContext
,信任全部protocol
- SSL协议,例如TLS等,null
表示默认TLSSSLContext
IORuntimeException
- 包装 GeneralSecurityException异常public static SSLContext createSSLContext(String protocol, KeyManager keyManager, TrustManager trustManager) throws IORuntimeException
protocol
- SSL协议,例如TLS等keyManager
- 密钥管理器,null
表示默认trustManager
- 信任管理器, null
表示默认SSLContext
IORuntimeException
- 包装 GeneralSecurityException异常public static SSLContext createSSLContext(KeyStore keyStore, char[] password) throws IORuntimeException
SSLContext
keyStore
- KeyStorepassword
- 密码SSLContext
IORuntimeException
- 包装 GeneralSecurityException异常public static SSLContext createSSLContext(KeyManager[] keyManagers, TrustManager[] trustManagers) throws IORuntimeException
SSLContext
keyManagers
- 密钥管理器,null
表示默认trustManagers
- 信任管理器, null
表示默认SSLContext
IORuntimeException
- 包装 GeneralSecurityException异常public static SSLContext createSSLContext(String protocol, KeyManager[] keyManagers, TrustManager[] trustManagers) throws IORuntimeException
SSLContext
protocol
- SSL协议,例如TLS等keyManagers
- 密钥管理器,null
表示默认trustManagers
- 信任管理器, null
表示默认SSLContext
IORuntimeException
- 包装 GeneralSecurityException异常Copyright © 2025. All rights reserved.