Examples of SimpleHash


Examples of org.apache.shiro.crypto.hash.SimpleHash

    public void encryptPassword(User user) {

        user.setSalt(randomNumberGenerator.nextBytes().toHex());

        String newPassword = new SimpleHash(
                algorithmName,
                user.getPassword(),
                ByteSource.Util.bytes(user.getCredentialsSalt()),
                hashIterations).toHex();
View Full Code Here

Examples of org.apache.shiro.crypto.hash.SimpleHash

    public void encryptPassword(User user) {

        user.setSalt(randomNumberGenerator.nextBytes().toHex());

        String newPassword = new SimpleHash(
                algorithmName,
                user.getPassword(),
                ByteSource.Util.bytes(user.getCredentialsSalt()),
                hashIterations).toHex();
View Full Code Here

Examples of org.apache.shiro.crypto.hash.SimpleHash

    public void encryptPassword(User user) {

        user.setSalt(randomNumberGenerator.nextBytes().toHex());

        String newPassword = new SimpleHash(
                algorithmName,
                user.getPassword(),
                ByteSource.Util.bytes(user.getCredentialsSalt()),
                hashIterations).toHex();
View Full Code Here

Examples of org.apache.shiro.crypto.hash.SimpleHash

    public void encryptPassword(User user) {

        user.setSalt(randomNumberGenerator.nextBytes().toHex());

        String newPassword = new SimpleHash(
                algorithmName,
                user.getPassword(),
                ByteSource.Util.bytes(user.getCredentialsSalt()),
                hashIterations).toHex();
View Full Code Here

Examples of org.apache.shiro.crypto.hash.SimpleHash

    public void encryptPassword(User user) {

        user.setSalt(randomNumberGenerator.nextBytes().toHex());

        String newPassword = new SimpleHash(
                algorithmName,
                user.getPassword(),
                ByteSource.Util.bytes(user.getCredentialsSalt()),
                hashIterations).toHex();
View Full Code Here

Examples of org.apache.shiro.crypto.hash.SimpleHash

    public void encryptPassword(User user) {

        user.setSalt(randomNumberGenerator.nextBytes().toHex());

        String newPassword = new SimpleHash(
                algorithmName,
                user.getPassword(),
                ByteSource.Util.bytes(user.getCredentialsSalt()),
                hashIterations).toHex();
View Full Code Here

Examples of org.apache.shiro.crypto.hash.SimpleHash

    public void encryptPassword(User user) {

        user.setSalt(randomNumberGenerator.nextBytes().toHex());

        String newPassword = new SimpleHash(
                algorithmName,
                user.getPassword(),
                ByteSource.Util.bytes(user.getCredentialsSalt()),
                hashIterations).toHex();
View Full Code Here

Examples of org.apache.shiro.crypto.hash.SimpleHash

  @RequestMapping("/change-password")
  public String changePassword(String oldPassword,String newPassword) {

    User user = SystemVariableUtils.getSessionVariable().getUser();
   
    oldPassword = new SimpleHash("MD5", oldPassword.toCharArray()).toString();
   
    if (!user.getPassword().equals(oldPassword)) {
      throw new ServiceException("旧密码不正确.");
    }
   
View Full Code Here

Examples of org.apache.shiro.crypto.hash.SimpleHash

   */
  //当修改成功后将shiro的认证缓存也更新清除
  @CacheEvict(value="shiroAuthenticationCache",key="#entity.getUsername()")
  public void updateUserPassword(User entity, String newPassword) {
   
    String temp = new SimpleHash("MD5",newPassword).toHex();
    userDao.updatePassword(entity.getId(),temp);
    entity.setPassword(temp);
  }
View Full Code Here

Examples of org.apache.shiro.crypto.hash.SimpleHash

  public void insertUser(User entity) {
    if (!isUsernameUnique(entity.getUsername())) {
      throw new ServiceException("登录帐号已存在");
    }
   
    String password = new SimpleHash("MD5", entity.getPassword()).toHex();
   
    entity.setPassword(password);
    userDao.insert(entity);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.