1 23 24 package com.sun.enterprise.security.jauth.callback; 25 26 import javax.security.auth.callback.Callback ; 27 import java.util.Arrays ; 28 29 34 public class PasswordValidationCallback implements Callback { 35 36 private String username; 37 private char[] password; 38 private boolean result = false; 39 40 47 public PasswordValidationCallback(String username, char[] password) { 48 this.username = username; 49 if (password != null) { 50 this.password = (char[])password.clone(); 51 } 52 } 53 54 59 public String getUsername() { 60 return username; 61 } 62 63 73 public char[] getPassword() { 74 return password; 75 } 76 77 80 public void clearPassword() { 81 if (password != null) { 82 Arrays.fill(password, ' '); 83 } 84 } 85 86 91 public void setResult(boolean result) { 92 this.result = result; 93 } 94 95 100 public boolean getResult() { 101 return result; 102 } 103 } 104 | Popular Tags |