public class DigestUtil extends Object
Constructor and Description |
---|
DigestUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
calculate(Digest digest,
char[] password)
Given the digest, construct the client response value
|
static byte[] |
calculateA1(String userName,
String realm,
char[] password) |
static byte[] |
calculateA2(String method,
String uri) |
static String |
calculateDigest(Digest digest,
byte[] ha1,
byte[] ha2) |
static String |
convertBytesToHex(byte[] bytes)
Convert a byte array to hex
|
static String |
extract(String token,
String key)
Given a digest token, extract the value
|
static boolean |
matchCredential(Digest digest,
char[] password)
Match the Client Response value with a generated digest based on the password
|
static byte[] |
md5(String str)
Determine the message digest
|
static String |
userName(String token) |
void |
validate(Digest digest,
String systemRealm,
String key) |
public static byte[] md5(String str)
str
- FormatException
public static String calculate(Digest digest, char[] password)
digest
- password
- FormatException
public static boolean matchCredential(Digest digest, char[] password)
digest
- password
- FormatException
public static String convertBytesToHex(byte[] bytes)
bytes
- public static String extract(String token, String key)
token
- key
- public void validate(Digest digest, String systemRealm, String key) throws DigestValidationException
DigestValidationException
Copyright © 2018 JBoss by Red Hat. All rights reserved.