Team LiB
Previous Section Next Section

PasswordCallbackjavax.security.auth.callback

Java 1.4serializable

This Callback class represents a request for a password. A CallbackHandler should handle it by displaying the prompt returned by getPrompt( ) and then allowing the user the enter a password. When the user has entered the password, it should pass the entered text to setPassword( ) . If isEchoOn( ) returns true, then the Handler should display the password as the user types it.

Figure 19-10. javax.security.auth.callback.PasswordCallback


public class PasswordCallback implements Callback, Serializable {
// Public Constructors
     public PasswordCallback(String prompt, boolean echoOn);  
// Public Instance Methods
     public void clearPassword( );  
     public char[ ] getPassword( );  
     public String getPrompt( );  
     public boolean isEchoOn( );  
     public void setPassword(char[ ] password);  
}

    Team LiB
    Previous Section Next Section