public class PasswordCallback
extends Object implements Callback, Serializable
| java.lang.Object | |
| javax.security.auth.callback.PasswordCallback | |
基础安全服务实例,并通过一个 PasswordCallback至 handle一个方法 CallbackHandler ,以获取密码信息。
也可以看看:
Public constructors |
|
|---|---|
PasswordCallback(String prompt, boolean echoOn) 使用提示符和布尔值构造一个 |
|
公共方法(Public methods) |
|
|---|---|
void |
clearPassword() 清除检索的密码。 |
char[] |
getPassword() 获取检索到的密码。 |
String |
getPrompt() 获取提示。 |
boolean |
isEchoOn() 返回输入密码时是否显示密码。 |
void |
setPassword(char[] password) 设置检索到的密码。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
PasswordCallback (String prompt, boolean echoOn)
用提示符和布尔值构造一个 PasswordCallback ,指定密码是否应该在键入时显示。
| 参数(Parameters) | |
|---|---|
prompt |
String: the prompt used to request the password. |
echoOn |
boolean: true if the password should be displayed as it is being typed. |
| 抛出异常(Throws) | |
|---|---|
IllegalArgumentException |
if prompt is null or if prompt has a length of 0. |
char[] getPassword ()
获取检索到的密码。
此方法返回检索到的密码的副本。
| 返回(Returns) | |
|---|---|
char[] |
the retrieved password, which may be null. |
也可以看看:
boolean isEchoOn ()
Return whether the password should be displayed as it is being typed.
| 返回(Returns) | |
|---|---|
boolean |
the whether the password should be displayed as it is being typed. |
void setPassword (char[] password)
设置检索到的密码。
在存储输入 密码之前,此方法会复制输入 密码 。
| 参数(Parameters) | |
|---|---|
password |
char: the retrieved password, which may be null. |
也可以看看: