Class UserPasswordPasswordUtil
- java.lang.Object
-
- org.wildfly.security.auth.realm.ldap.UserPasswordPasswordUtil
-
class UserPasswordPasswordUtil extends Object
A password utility for LDAP formatted passwords.- Author:
- Darran Lofthouse
-
-
Constructor Summary
Constructors Modifier Constructor Description privateUserPasswordPasswordUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static byte[]composeDigestSalt(SaltedSimpleDigestPassword password, Encoding hashEncoding)static byte[]composeUserPassword(Password password)static byte[]composeUserPassword(Password password, Encoding hashEncoding)private static PasswordcreateClearPassword(int skip, byte[] userPassword)private static PasswordcreateSaltedSimpleDigestPassword(String algorithm, int prefixSize, byte[] userPassword, Encoding hashEncoding)private static PasswordcreateSimpleDigestPassword(String algorithm, int prefixSize, byte[] userPassword, Encoding hashEncoding)private static intexpectedDigestLengthBytes(String algorithm)static booleanisAlgorithmSupported(String algorithm)static PasswordparseUserPassword(byte[] userPassword)static PasswordparseUserPassword(byte[] userPassword, Encoding hashEncoding)private static booleanprefixEqual(int skip, byte[] pattern, byte[] array)private static byteupper(byte character)
-
-
-
Method Detail
-
parseUserPassword
public static Password parseUserPassword(byte[] userPassword) throws InvalidKeySpecException
- Throws:
InvalidKeySpecException
-
parseUserPassword
public static Password parseUserPassword(byte[] userPassword, Encoding hashEncoding) throws InvalidKeySpecException
- Throws:
InvalidKeySpecException
-
upper
private static byte upper(byte character)
-
prefixEqual
private static boolean prefixEqual(int skip, byte[] pattern, byte[] array)
-
createClearPassword
private static Password createClearPassword(int skip, byte[] userPassword)
-
createSimpleDigestPassword
private static Password createSimpleDigestPassword(String algorithm, int prefixSize, byte[] userPassword, Encoding hashEncoding) throws InvalidKeySpecException
- Throws:
InvalidKeySpecException
-
createSaltedSimpleDigestPassword
private static Password createSaltedSimpleDigestPassword(String algorithm, int prefixSize, byte[] userPassword, Encoding hashEncoding) throws InvalidKeySpecException
- Throws:
InvalidKeySpecException
-
expectedDigestLengthBytes
private static int expectedDigestLengthBytes(String algorithm)
-
composeUserPassword
public static byte[] composeUserPassword(Password password) throws IOException
- Throws:
IOException
-
composeUserPassword
public static byte[] composeUserPassword(Password password, Encoding hashEncoding) throws IOException
- Throws:
IOException
-
composeDigestSalt
private static byte[] composeDigestSalt(SaltedSimpleDigestPassword password, Encoding hashEncoding)
-
isAlgorithmSupported
public static boolean isAlgorithmSupported(String algorithm)
-
-