public void setPassword(final String password, final String passwordSecret) {
if (password == null || "".equals(password)) {
// If no password is given, we leave the hashed password empty and we fail during validation.
setHashedPassword("");
} else {
final String newPassword = new SimpleHash("SHA-1", password, passwordSecret).toString();
setHashedPassword(newPassword);
}
}