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 private
UserPasswordPasswordUtil()
-
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 Password
createClearPassword(int skip, byte[] userPassword)
private static Password
createSaltedSimpleDigestPassword(String algorithm, int prefixSize, byte[] userPassword, Encoding hashEncoding)
private static Password
createSimpleDigestPassword(String algorithm, int prefixSize, byte[] userPassword, Encoding hashEncoding)
private static int
expectedDigestLengthBytes(String algorithm)
static boolean
isAlgorithmSupported(String algorithm)
static Password
parseUserPassword(byte[] userPassword)
static Password
parseUserPassword(byte[] userPassword, Encoding hashEncoding)
private static boolean
prefixEqual(int skip, byte[] pattern, byte[] array)
private static byte
upper(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)
-
-