public class DigestUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
decodeBase64(String str)
Decode a string using Base64 encoding.
|
static String |
decodeCharset(String str,
String charsetName)
Deprecated.
Use
|
static String |
encodeBase64(String str)
Encode a string using Base64 encoding.
|
static String |
encodeCharset(String str,
String charsetName)
Deprecated.
Use
|
static String |
encodePassword(String password,
String algorithm)
Encode a string using algorithm specified in web.xml and return the
resulting encrypted password.
|
@Deprecated public static String encodeCharset(String str, String charsetName)
str - target stringcharsetName - the name of a supported charset@Deprecated public static String decodeCharset(String str, String charsetName)
str - target stringcharsetName - the name of a supported charsetpublic static String encodeBase64(String str)
str - String to be encodedBaseNCodec.encode(byte[])public static String decodeBase64(String str)
str - String to be decodedBaseNCodec.decode(String)public static String encodePassword(String password, String algorithm) throws NoSuchAlgorithmException
password - Password or other credentials to use in authenticating this
usernamealgorithm - Algorithm used to do the digestNoSuchAlgorithmException - throws No Such Algorithm ExceptionCopyright © 2018. All rights reserved.