public final class ModularCrypt extends Object
Modifier and Type | Method and Description |
---|---|
static void |
composePassword(ByteArrayOutputStream out,
Password password) |
static Password |
createPassword(byte[] password,
String algorithm) |
static Password |
decode(char[] cryptString)
Decode the given char array and creates a
Password instance. |
static Password |
decode(String cryptString)
Decode the given string and creates a
Password instance. |
static char[] |
encode(Password password)
Encode the given
Password to a char array. |
static String |
encodeAsString(Password password)
Encode the given
Password to a string. |
static String |
identifyAlgorithm(char[] chars)
Attempt to identify the algorithm used by the given crypt string password.
|
public static String identifyAlgorithm(char[] chars)
chars
- the password crypt string charactersnull
if no algorithm could be guessedpublic static char[] encode(Password password) throws InvalidKeySpecException
Password
to a char array.password
- the password to encodeInvalidKeySpecException
- if the given password is not supported or could be encodedpublic static String encodeAsString(Password password) throws InvalidKeySpecException
Password
to a string.password
- the password to encodeInvalidKeySpecException
- if the given password is not supported or could be encodedpublic static Password decode(String cryptString) throws InvalidKeySpecException
Password
instance.cryptString
- the string representing the encoded format of the passwordPassword
instance created from the given stringInvalidKeySpecException
- if the given password is not supported or could be decodedpublic static Password decode(char[] cryptString) throws InvalidKeySpecException
Password
instance.cryptString
- the char array representing the encoded format of the passwordPassword
instance created from the given stringInvalidKeySpecException
- if the given password is not supported or could be decodedpublic static Password createPassword(byte[] password, String algorithm) throws InvalidKeySpecException
InvalidKeySpecException
public static void composePassword(ByteArrayOutputStream out, Password password) throws IOException
IOException
Copyright © 2021 JBoss by Red Hat. All rights reserved.