|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.directory.sql.PasswordHelper
public class PasswordHelper
Helper to check passwords and generated hashed salted ones.
Field Summary | |
---|---|
static String |
SMD5
|
static String |
SSHA
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SSHA
public static final String SMD5
Method Detail |
---|
public static boolean isHashed(String password)
password
-
true
if the password is hashedpublic static String hashPassword(String password, String algorithm)
algorithm
- the algorithm, SSHA
or SMD5
, or
null
to not hashpassword
- the password
public static boolean verifyPassword(String password, String hashedPassword)
password
- the password to verifyhashedPassword
- the hashed password
true
if the password matchespublic static byte[] digestWithSalt(String password, byte[] salt, String algorithm)
|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |