public class PasswordCallback extends Object implements Callback, Serializable
基本的安全服务,通过PasswordCallback
实例化的CallbackHandler
的handle
方法找回密码信息。
CallbackHandler
,
Serialized Form
Constructor and Description |
---|
PasswordCallback(String prompt, boolean echoOn)
构造一个提示和指定密码是否应显示为被打
PasswordCallback 。
|
Modifier and Type | Method and Description |
---|---|
void |
clearPassword()
清除检索的密码。
|
char[] |
getPassword()
获取检索的密码。
|
String |
getPrompt()
得到提示。
|
boolean |
isEchoOn()
返回是否要将密码显示为正在键入的。
|
void |
setPassword(char[] password)
设置检索的密码。
|
public PasswordCallback(String prompt, boolean echoOn)
PasswordCallback
。
prompt
用于请求密码提示。
echoOn
-如果密码应该显示为正型。
IllegalArgumentException
-如果
prompt
长度为0
prompt
无效或。
public String getPrompt()
public boolean isEchoOn()
public void setPassword(char[] password)
这种方法使得一份输入密码保存它之前。
password
-找回密码,这可能是空的。
getPassword()
public char[] getPassword()
此方法返回检索的密码的副本。
setPassword(char[])
public void clearPassword()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.