public class SaslUtil extends Object
| Constructor and Description |
|---|
SaslUtil() |
| Modifier and Type | Method and Description |
|---|---|
static SaslClient |
createClient(String[] mechanisms,
String authorizationId,
String protocol,
String serverName,
Map<String,?> props,
CallbackHandler cbh)
创建SASL客户端
它封装了 Sasl.createSaslClient方法,提供了一层抽象,以便更方便地处理SASL客户端的创建 |
static SaslServer |
createServer(String mechanism,
String protocol,
String serverName,
Map<String,?> props,
CallbackHandler cbh)
创建一个SASL服务器
这个方法封装了Sasl服务器的创建过程,提供一个统一的方式来初始化SASL服务器实例
|
public static SaslServer createServer(String mechanism, String protocol, String serverName, Map<String,?> props, CallbackHandler cbh)
mechanism - 身份验证机制protocol - 应用程序协议,例如"SCRAM-SHA-256"serverName - 服务器名称,用于身份验证props - 与机制相关的属性,可以是任何相关的配置参数cbh - 回调处理器,用于身份验证过程中的用户交互SaslServerCryptoException - 如果在创建SASL服务器过程中发生错误public static SaslClient createClient(String[] mechanisms, String authorizationId, String protocol, String serverName, Map<String,?> props, CallbackHandler cbh)
Sasl.createSaslClient方法,提供了一层抽象,以便更方便地处理SASL客户端的创建mechanisms - 尝试多个身份验证机制的名称authorizationId - 授权ID,用于代表用户进行身份验证protocol - 此SASL客户端所涉及的协议serverName - 服务器的名称props - 额外的属性,用于身份验证过程cbh - 回调处理器,用于处理身份验证过程中的交互CryptoException - 如果SASL客户端创建过程中发生异常Copyright © 2025. All rights reserved.