Package com.abavilla.fpi.login.util
Class LoginUtil
java.lang.Object
com.abavilla.fpi.login.util.LoginUtil
Utility methods used by the Login API service
- Author:
- Vince Villamora
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic char[]hashPassword(char[] password) Hashes password with BCryptvoidinit(io.quarkus.runtime.StartupEvent evt) Initialize utility library.static booleanverifyHash(char[] password, char[] hash) Checks if hash matches with password.
-
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- Passwordhash- Hash- Returns:
trueif a match otherwisefalse
-