|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.mapreduce.security.SecureShuffleUtils
public class SecureShuffleUtils
utilities for generating kyes, hashes and verifying them for shuffle
Field Summary | |
---|---|
static String |
HTTP_HEADER_REPLY_URL_HASH
|
static String |
HTTP_HEADER_URL_HASH
|
Constructor Summary | |
---|---|
SecureShuffleUtils()
|
Method Summary | |
---|---|
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) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String HTTP_HEADER_URL_HASH
public static final String HTTP_HEADER_REPLY_URL_HASH
Constructor Detail |
---|
public SecureShuffleUtils()
Method Detail |
---|
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
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |