Most visited

Recently visited

Added in API level 1

PasswordCallback

public class PasswordCallback
extends Object implements Callback, Serializable

java.lang.Object
   ↳ javax.security.auth.callback.PasswordCallback


基础安全服务实例,并通过一个 PasswordCallbackhandle一个方法 CallbackHandler ,以获取密码信息。

也可以看看:

Summary

Public constructors

PasswordCallback(String prompt, boolean echoOn)

使用提示符和布尔值构造一个 PasswordCallback ,指定是否应该在键入密码时显示密码。

Public methods

void clearPassword()

清除检索的密码。

char[] getPassword()

获取检索到的密码。

String getPrompt()

获取提示。

boolean isEchoOn()

返回输入密码时是否显示密码。

void setPassword(char[] password)

设置检索到的密码。

Inherited methods

From class java.lang.Object

Public constructors

PasswordCallback

Added in API level 1
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.

Public methods

clearPassword

Added in API level 1
void clearPassword ()

清除检索的密码。

getPassword

Added in API level 1
char[] getPassword ()

获取检索到的密码。

此方法返回检索到的密码的副本。

Returns
char[] the retrieved password, which may be null.

也可以看看:

getPrompt

Added in API level 1
String getPrompt ()

获取提示。

Returns
String the prompt.

isEchoOn

Added in API level 1
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.

setPassword

Added in API level 1
void setPassword (char[] password)

设置检索到的密码。

在存储输入 密码之前,此方法会复制输入 密码

Parameters
password char: the retrieved password, which may be null.

也可以看看:

Hooray!