Class Overview
Used in conjunction with a CallbackHandler
to retrieve a password
when needed.
Summary
Public Methods |
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.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Called before the object's memory is reclaimed by the VM.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Public Constructors
public
PasswordCallback
(String prompt, boolean echoOn)
Creates a new PasswordCallback
instance.
Parameters
prompt
| the message that should be displayed to the user |
echoOn
| determines whether the user input should be echoed
|
Public Methods
public
void
clearPassword
()
Clears the password stored in this PasswordCallback
.
public
char[]
getPassword
()
Returns the password. The security service that needs the password
usually calls this method once the CallbackHandler
has finished
its work.
Returns
- the password. A copy of the internal password is created and
returned, so subsequent changes to the internal password do not
affect the result.
public
String
getPrompt
()
Returns the prompt that was specified when creating this PasswordCallback
public
boolean
isEchoOn
()
Queries whether this PasswordCallback
expects user input to be
echoed, which is specified during the creation of the object.
Returns
true
if (and only if) user input should be echoed
public
void
setPassword
(char[] password)
Sets the password. The 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.
Parameters
password
| the password. A copy of this is stored, so subsequent changes
to the input array do not affect the PasswordCallback .
|