data.setPassword(password);
data.setPassword(newpasswd);
    public void setPassword(Admin admin, String username, String password) throws UserDoesntFullfillEndEntityProfile, AuthorizationDeniedException, FinderException{        debug(">setPassword("+username+", hiddenpwd)");        // Find user        UserDataPK pk = new UserDataPK(username);        UserDataLocal data = home.findByPrimaryKey(pk);        int caid = data.getCAId();        if(getGlobalConfiguration(admin).getEnableEndEntityProfileLimitations()){          // Check if user fulfills it's profile.          EndEntityProfile profile = raadminsession.getEndEntityProfile(admin, data.getEndEntityProfileId());               boolean fullfillsprofile = true;                    if(!profile.isModifyable(EndEntityProfile.PASSWORD,0)){            if(!password.equals(profile.getValue(EndEntityProfile.PASSWORD,0)));              fullfillsprofile=false;          }          else            if(profile.isRequired(EndEntityProfile.PASSWORD,0)){              if(password == null || password.trim().equals(""))                fullfillsprofile=false;            }          if(!fullfillsprofile){            logsession.log(admin, caid, LogEntry.MODULE_RA, new java.util.Date(),username, null, LogEntry.EVENT_ERROR_CHANGEDENDENTITY,"Password didn't fulfill end entity profile.");            throw new UserDoesntFullfillEndEntityProfile("Password didn't fulfill end entity profile.");          }          // Check if administrator is authorized to edit user.          if(!authorizedToEndEntityProfile(admin, data.getEndEntityProfileId(), AvailableAccessRules.EDIT_RIGHTS)){            logsession.log(admin, caid, LogEntry.MODULE_RA, new java.util.Date(),username, null, LogEntry.EVENT_ERROR_CHANGEDENDENTITY,"Administrator isn't authorized to change password.");            throw new AuthorizationDeniedException("Administrator not authorized to edit user.");          }        }        if(!authorizedToCA(admin, caid)){          logsession.log(admin, caid, LogEntry.MODULE_RA,  new java.util.Date(),username, null, LogEntry.EVENT_ERROR_CHANGEDENDENTITY,"Administrator not authorized to change password of user with current CA.");          throw new AuthorizationDeniedException("Administrator not authorized to set password to user with given CA.");        }                         try {            data.setPassword(password);            data.setTimeModified((new java.util.Date()).getTime());            logsession.log(admin, caid, LogEntry.MODULE_RA, new java.util.Date(),username, null, LogEntry.EVENT_INFO_CHANGEDENDENTITY,"Password changed.");        }catch (java.security.NoSuchAlgorithmException nsae)        {            debug("NoSuchAlgorithmException while setting password for user "+username);            throw new EJBException(nsae);        }        debug("<setPassword("+username+", hiddenpwd)");    } // setPassword