public class SecureShuffleUtils extends Object
限定符和类型 | 字段和说明 |
---|---|
static String |
HTTP_HEADER_REPLY_URL_HASH |
static String |
HTTP_HEADER_URL_HASH |
构造器和说明 |
---|
SecureShuffleUtils() |
限定符和类型 | 方法和说明 |
---|---|
static String |
buildMsgFrom(javax.servlet.http.HttpServletRequest request)
Shuffle specific utils - build string for encoding from URL
|
static String |
buildMsgFrom(URL url)
Shuffle specific utils - build string for encoding from URL
|
static String |
generateHash(byte[] msg,
SecretKey key)
Base64 encoded hash of msg
|
static String |
hashFromString(String enc_str,
SecretKey key)
Aux util to calculate hash of a String
|
static String |
toHex(byte[] ba)
byte array to Hex String
|
static void |
verifyReply(String base64Hash,
String msg,
SecretKey key)
verify that base64Hash is same as HMacHash(msg)
|
public static String generateHash(byte[] msg, SecretKey key)
msg
- public static String hashFromString(String enc_str, SecretKey key) throws IOException
enc_str
- key
- IOException
public static void verifyReply(String base64Hash, String msg, SecretKey key) throws IOException
base64Hash
- (Base64 encoded hash)msg
- IOException
- if not the samepublic static String buildMsgFrom(URL url)
url
- public static String buildMsgFrom(javax.servlet.http.HttpServletRequest request)
request
- public static String toHex(byte[] ba)
ba
- Copyright © 2009 The Apache Software Foundation