data.setOpenPassword(password);
data.setOpenPassword(newpasswd);
    public void setClearTextPassword(Admin admin, String username, String password) throws UserDoesntFullfillEndEntityProfile, AuthorizationDeniedException,FinderException{        debug(">setClearTextPassword("+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());          if(profile.isRequired(EndEntityProfile.CLEARTEXTPASSWORD,0) && profile.getValue(EndEntityProfile.CLEARTEXTPASSWORD,0).equals(EndEntityProfile.FALSE)){            logsession.log(admin, caid, LogEntry.MODULE_RA, new java.util.Date(),username, null, LogEntry.EVENT_ERROR_CHANGEDENDENTITY,"Clearpassword didn't fullfill end entity profile.");            throw new UserDoesntFullfillEndEntityProfile("Clearpassword didn't fullfill 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 clearpassword.");            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 cleartext password to user with given CA.");        }                         try {            if (password == null){                data.setClearPassword("");                data.setTimeModified((new java.util.Date()).getTime());                logsession.log(admin, caid, LogEntry.MODULE_RA, new java.util.Date(),username, null, LogEntry.EVENT_INFO_CHANGEDENDENTITY,"Clearpassword changed.");            }            else{                data.setOpenPassword(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,"Clearpassword changed.");            }        } catch (java.security.NoSuchAlgorithmException nsae)        {            debug("NoSuchAlgorithmException while setting password for user "+username);            throw new EJBException(nsae);        }        debug("<setClearTextPassword("+username+", hiddenpwd)");    } // setClearTextPassword