public class PasswordCallback extends Object implements Callback, Serializable
CallbackHandler to retrieve a password
when needed.| Constructor and Description |
|---|
PasswordCallback(String prompt,
boolean echoOn)
Creates a new
PasswordCallback instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearPassword()
Clears the password stored in this
PasswordCallback. |
char[] |
getPassword()
Returns the password.
|
String |
getPrompt()
Returns the prompt that was specified when creating this
PasswordCallback |
boolean |
isEchoOn()
Queries whether this
PasswordCallback expects user input to be
echoed, which is specified during the creation of the object. |
void |
setPassword(char[] password)
Sets the password.
|
public PasswordCallback(String prompt, boolean echoOn)
PasswordCallback instance.prompt - the message that should be displayed to the userechoOn - determines whether the user input should be echoedpublic String getPrompt()
PasswordCallbackpublic boolean isEchoOn()
PasswordCallback expects user input to be
echoed, which is specified during the creation of the object.true if (and only if) user input should be echoedpublic void setPassword(char[] password)
CallbackHandler that performs the actual
provisioning or input of the password needs to call this method to hand
back the password to the security service that requested it.password - the password. A copy of this is stored, so subsequent changes
to the input array do not affect the PasswordCallback.public char[] getPassword()
CallbackHandler has finished
its work.public void clearPassword()
PasswordCallback.