public class Security
extends java.lang.Object
Constructor and Description |
---|
Security() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkPassword(java.lang.String dbPassword,
java.lang.String password)
Compare the hashed password from the DB with the one in clear text provided by the user.
|
static java.lang.String |
encrypt(java.lang.String password)
Encrypts the password using the chosen algorithm and returns the encrypted password.
|
public static java.lang.String encrypt(java.lang.String password) throws java.security.NoSuchAlgorithmException
password
- in clear textjava.security.NoSuchAlgorithmException
- thrown if the chosen algorithm isn't available.public static boolean checkPassword(java.lang.String dbPassword, java.lang.String password) throws java.security.NoSuchAlgorithmException
dbPassword
- raw encrypted password value from the databasepassword
- the password in clear text as entered by the userjava.security.NoSuchAlgorithmException
- thrown if the chosen algorithm isn't available.Copyright © 2018 DS Data Systems UK Ltd.