public class PasswordHelper extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
digestWithSalt(String password,
byte[] salt,
String algorithm) |
static String |
hashPassword(String password,
String algorithm)
Returns the hashed string for a password according to a given hashing algorithm.
|
static boolean |
isHashed(String password)
Checks if a password is already hashed.
|
static boolean |
verifyPassword(String password,
String hashedPassword)
Verify a password against a hashed password.
|
public static final String SSHA
public static final String SMD5
public static boolean isHashed(String password)
true
if the password is hashedpublic static String hashPassword(String password, String algorithm)
public static boolean verifyPassword(String password, String hashedPassword)
If the hashed password is null
then the verification always fails.
password
- the password to verifyhashedPassword
- the hashed passwordtrue
if the password matchespublic static byte[] digestWithSalt(String password, byte[] salt, String algorithm)
Copyright © 2017 Nuxeo. All rights reserved.