@InterfaceAudience.Private @InterfaceStability.Unstable public class SecureShuffleUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HTTP_HEADER_REPLY_URL_HASH |
static String |
HTTP_HEADER_URL_HASH |
Constructor and Description |
---|
SecureShuffleUtils() |
Modifier and Type | Method and Description |
---|---|
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,
org.apache.tez.common.security.JobTokenSecretManager mgr)
Aux util to calculate hash of a String
|
static void |
verifyReply(String base64Hash,
String msg,
org.apache.tez.common.security.JobTokenSecretManager mgr)
verify that base64Hash is same as HMacHash(msg)
|
static void |
verifyReply(String base64Hash,
String msg,
SecretKey key)
Verify that the base64 encoded hash matches the hash generated by making use of the provided
key on the specified message.
|
public static final String HTTP_HEADER_URL_HASH
public static final String HTTP_HEADER_REPLY_URL_HASH
public static String generateHash(byte[] msg, SecretKey key)
msg
- public static String hashFromString(String enc_str, org.apache.tez.common.security.JobTokenSecretManager mgr) throws IOException
enc_str
- mgr
- JobTokenSecretManagerIOException
public static void verifyReply(String base64Hash, String msg, SecretKey key) throws IOException
base64Hash
- base64 encoded hashmsg
- the messagekey
- the key to use to generate the hash from the messageIOException
public static void verifyReply(String base64Hash, String msg, org.apache.tez.common.security.JobTokenSecretManager mgr) throws IOException
base64Hash
- (Base64 encoded hash)msg
- IOException
- if not the sameCopyright © 2016 Apache Software Foundation. All rights reserved.