Class LoginUtil

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

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static char[]
    hashPassword(char[] password)
    Hashes password with BCrypt
    void
    init(io.quarkus.runtime.StartupEvent evt)
    Initialize utility library.
    static boolean
    verifyHash(char[] password, char[] hash)
    Checks if hash matches with password.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LoginUtil

      public LoginUtil()
  • Method Details

    • init

      public void init(@Observes io.quarkus.runtime.StartupEvent evt)
      Initialize utility library.
      Parameters:
      evt - the startup event
    • 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