public class SSLManager extends Object
Constructor and Description |
---|
SSLManager(String protocol)
构造函数
默认使用客户端认证
|
SSLManager(String protocol,
boolean useClientAuth)
构造函数
|
Modifier and Type | Method and Description |
---|---|
SSLParser |
createClientSSLParser(IoSession session)
获取SSLParser
|
SSLParser |
createServerSSLParser(IoSession session)
获取Server 模式 SSLParser
|
void |
loadKey(byte[] manageCert,
String certPassword,
String keyPassword)
读取管理证书, 字节形式
|
void |
loadKey(String manageCertFile,
String certPassword,
String keyPassword)
读取管理证书, 文件形式
|
void |
loadTrustKey(byte[] manageCert,
String certPassword)
读取管理证书, 字节形式
|
void |
loadTrustKey(String manageCertFile,
String certPassword)
读取管理证书, 文件形式
|
public SSLManager(String protocol) throws NoSuchAlgorithmException
protocol
- 协议类型NoSuchAlgorithmException
- 无可用协议异常public SSLManager(String protocol, boolean useClientAuth) throws SSLException
protocol
- 协议类型useClientAuth
- 是否使用客户端认证, true:双向认证, false: 单向认证SSLException
- SSL 异常public void loadKey(String manageCertFile, String certPassword, String keyPassword) throws SSLException
manageCertFile
- 证书地址certPassword
- 证书密码keyPassword
- 密钥SSLException
- SSL 异常public void loadTrustKey(String manageCertFile, String certPassword) throws SSLException
manageCertFile
- 证书地址certPassword
- 证书密码SSLException
- SSL 异常public void loadKey(byte[] manageCert, String certPassword, String keyPassword) throws SSLException
manageCert
- 证书字节码certPassword
- 证书密码keyPassword
- 密钥SSLException
- SSL 异常public void loadTrustKey(byte[] manageCert, String certPassword) throws SSLException
manageCert
- 证书字节码certPassword
- 证书密码SSLException
- SSL 异常public SSLParser createClientSSLParser(IoSession session) throws SSLException
session
- session 对象SSLException
- SSL 异常public SSLParser createServerSSLParser(IoSession session) throws SSLException
session
- session 对象SSLException
- SSL 异常Copyright © 2020 Voovan. All rights reserved.