VerifyPasswordCallback vpc = (VerifyPasswordCallback) current;
vpc.setVerified(password.equals(vpc.getPassword()));
} else if (current instanceof DigestHashCallback) {
DigestHashCallback dhc = (DigestHashCallback) current;
try {
UsernamePasswordHashUtil uph = new UsernamePasswordHashUtil();
if (userName == null || realm == null) {
throw MESSAGES.insufficientInformationToGenerateHash();
}
dhc.setHash(uph.generateHashedURP(userName, realm, password.toCharArray()));
} catch (NoSuchAlgorithmException e) {
throw MESSAGES.unableToGenerateHash(e);
}
}
}