Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.security.auth.callback
Class PasswordCallback  view PasswordCallback download PasswordCallback.java

java.lang.Object
  extended byjavax.security.auth.callback.PasswordCallback
All Implemented Interfaces:
Callback, java.io.Serializable

public class PasswordCallback
extends java.lang.Object
implements Callback, java.io.Serializable

Underlying security services instantiate and pass a PasswordCallback to the handle() method of a CallbackHandler to retrieve password information.


Field Summary
private  boolean echoOn
           
private  char[] inputPassword
           
private  java.lang.String prompt
           
 
Constructor Summary
PasswordCallback(java.lang.String prompt, boolean echoOn)
          Construct a PasswordCallback with a prompt and a boolean specifying whether the password should be displayed as it is being typed.
 
Method Summary
 void clearPassword()
          Clear the retrieved password.
 char[] getPassword()
          Get the retrieved password.
 java.lang.String getPrompt()
          Get the prompt.
 boolean isEchoOn()
          Return whether the password should be displayed as it is being typed.
 void setPassword(char[] password)
          Set the retrieved password.
private  void setPrompt(java.lang.String prompt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prompt

private java.lang.String prompt
Since:
1.4

echoOn

private boolean echoOn
Since:
1.4

inputPassword

private char[] inputPassword
Since:
1.4
Constructor Detail

PasswordCallback

public PasswordCallback(java.lang.String prompt,
                        boolean echoOn)
Construct a PasswordCallback with a prompt and a boolean specifying whether the password should be displayed as it is being typed.

Method Detail

getPrompt

public java.lang.String getPrompt()
Get the prompt.


isEchoOn

public boolean isEchoOn()
Return whether the password should be displayed as it is being typed.


setPassword

public void setPassword(char[] password)

Set the retrieved password.

This method makes a copy of the input password before storing it.


getPassword

public char[] getPassword()

Get the retrieved password.

This method returns a copy of the retrieved password.


clearPassword

public void clearPassword()
Clear the retrieved password.


setPrompt

private void setPrompt(java.lang.String prompt)
                throws java.lang.IllegalArgumentException