Class LoginUtil

java.lang.Object
com.abavilla.fpi.login.util.LoginUtil

@Singleton public class LoginUtil extends Object
Utility methods used by the Login API service
Author:
Vince Villamora
  • Constructor Details

    • LoginUtil

      public LoginUtil()
  • Method Details

    • init

      @PostConstruct public void init()
      Initialize utility library.
    • hashPassword

      public static char[] hashPassword(char[] password)
      Hashes password with BCrypt
      Parameters:
      password - Unhashed password
      Returns:
      Hash password
    • verifyHash

      public static boolean verifyHash(char[] password, char[] hash)
      Checks if hash matches with password.
      Parameters:
      password - Password
      hash - Hash
      Returns:
      true if a match otherwise false