Package org.nuxeo.ecm.directory
Class PasswordHelper
java.lang.Object
org.nuxeo.ecm.directory.PasswordHelper
Helper to check passwords and generated hashed salted ones.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
Checks if a password is already hashed.static boolean
verifyPassword
(String password, String hashedPassword) Verify a password against a hashed password.
-
Field Details
-
SSHA
- See Also:
-
SSHA512
- Since:
- 2021.13
- See Also:
-
SMD5
- See Also:
-
-
Method Details
-
isHashed
Checks if a password is already hashed.- Returns:
true
if the password is hashed
-
hashPassword
Returns the hashed string for a password according to a given hashing algorithm. -
verifyPassword
Verify a password against a hashed password.If the hashed password is
null
then the verification always fails.- Parameters:
password
- the password to verifyhashedPassword
- the hashed password- Returns:
true
if the password matches
-
digestWithSalt
-