1package javax.security.auth.callback; 2 3public class PasswordCallback implements Callback 4{ 5 private String prompt; 6 private boolean echoOn = false; 7 private String password; 8 9 public PasswordCallback(String prompt) 10 { 11 this.prompt = prompt; 12 } 13 14 public PasswordCallback(String prompt, boolean echoOn) 15 { 16 this.prompt = prompt; 17 this.echoOn = echoOn; 18 } 19 20 public boolean isEchoOn() 21 { 22 return echoOn; 23 } 24 25 public String getPassword() 26 { 27 return password; 28 } 29 30 public void setPassword(char[] password) 31 { 32 this.password = new String(password); 33 } 34} 35