private boolean validateUser() throws NoSuchAlgorithmException {

		boolean valid = false;
		User user = new User();
		BigInteger encryptedPassword = encryptPassword(String
				.valueOf(login.txtPassword.getPassword()));
		user.setPassword(encryptedPassword);
		user.setRole(login.cmbUserRole.getSelectedItem().toString());
		User foundUser = dao.findEntity(user, user.getRole());
		LOGGER.debug(foundUser.getRole());
		if (foundUser.getPassword().equals(
				String.valueOf(login.txtPassword.getPassword()))) {
			// if (foundUser.getPassword().equals(user.getPassword())) {
			LOGGER.debug("user found");
			valid = true;
			userRole = foundUser.getRole();
			login.dispose();
		}
		return valid;
	}