Package org.jasypt.util.password

Examples of org.jasypt.util.password.BasicPasswordEncryptor.checkPassword()


  }
 
  public static boolean checkPassword(String plainPassword, String encryptedPassword)
  {
    BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
    return (passwordEncryptor.checkPassword(plainPassword, encryptedPassword));
  }
}
View Full Code Here


    // "Encrypt password", is not an real encryption because "Encryptor"
    // generate a digest. by default the MD5 algorithm is used
    String encryptedPassword = bpe.encryptPassword(TEXT_TO_ENCRYPT);
    System.out.printf("testPasswordEncryptionUsingBasicEncryptor : '%s' become '%s'\n", TEXT_TO_ENCRYPT, encryptedPassword);
    // Valid "encrypted" password
    Assert.assertTrue(bpe.checkPassword(TEXT_TO_ENCRYPT, encryptedPassword));
  }

  /**
   * This test show how encrypt a password using a strong encryptor, same
   * stuff is provided for Number encryption, see StrongInteger* and
 
View Full Code Here

            BasicPasswordEncryptor  encriptador = new BasicPasswordEncryptor();

            //FIXME: duda como hacer esto más seguro
        if (usuario != null) {
                // Comprobamos la clave
                if (encriptador.checkPassword( password, usuario.getPassword())) {
                    // Rellenamos la información del log
                    logger.info("Login correcto del usuario: " + usuarioLogin);

                    // Metemos en sesión el usuario actual
                    request.getSession().setAttribute(Constantes.USER_INFO,
View Full Code Here

  public boolean matchPassword(String password) {
    PasswordEncryptor encryptor = new BasicPasswordEncryptor();

    try {
      return encryptor.checkPassword(password, this.password);
    } catch (EncryptionOperationNotPossibleException ex) {
      return false;
    }
  }
View Full Code Here

  public Users loginCheck(String id, String pass) {
       
    Users validate = usersRepository.findOne(id);
   
    BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
    if ((validate != null && validate.getEnabled()) && passwordEncryptor.checkPassword(pass, validate.getPassword())){
      return validate;
    } else{
      return null;
    }
  }
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.