public final class BSDMD5Crypt extends Object
Modifier and Type | Method and Description |
---|---|
static String |
crypt(ByteSequence password)
Encode the supplied password in BSD MD5 crypt form, using a random salt.
|
static String |
crypt(ByteSequence password,
String salt)
Encode the supplied password in BSD MD5 crypt form, using provided salt.
|
static String |
getMagicString()
Getter to the BSD MD5 magic string.
|
static void |
main(String[] argv)
Main test method.
|
public static String crypt(ByteSequence password) throws NoSuchAlgorithmException
password
- A password to encode.NoSuchAlgorithmException
- If the MD5 algorithm is not supported.public static String crypt(ByteSequence password, String salt) throws NoSuchAlgorithmException
password
- A password to encode.salt
- A salt string of any size, of which only the first 8 bytes will be considered.NoSuchAlgorithmException
- If the MD5 algorithm is not supported.public static String getMagicString()
public static void main(String[] argv)
argv
- The array of test argumentsCopyright 2010-2018 ForgeRock AS.