public class Utils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Utils.HMACHashingAlgo |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ENCODING_SCHEME |
static java.lang.String |
HMAC_TOKEN_SEPARATOR |
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
getAgentHashKey(java.lang.String id,
java.util.logging.Logger logger,
byte[] sharedSecret)
Generates the key for HMAC Hash for agent payload validation
|
static byte[] |
getDecryptedSecret(java.lang.String encryptedText,
byte[] dccAgentKey,
java.util.logging.Logger logger) |
static java.lang.String |
getHmacShaSalt(byte[] key,
java.lang.String data,
Utils.HMACHashingAlgo algo,
java.util.logging.Logger LOGGER) |
static boolean |
validateHmacShaSalt(byte[] key,
java.lang.String inputHash,
java.lang.String data,
Utils.HMACHashingAlgo algo,
java.util.logging.Logger LOGGER)
Below method first convert the incoming Hash to lower case because webgate use nz lib
which produces hash with letter in upper case and Java API produces Hash with chars in
equalsIgnoreCase will most likely be less performant than this approach
lower case
|
public static final java.lang.String ENCODING_SCHEME
public static final java.lang.String HMAC_TOKEN_SEPARATOR
public static java.lang.String getHmacShaSalt(byte[] key, java.lang.String data, Utils.HMACHashingAlgo algo, java.util.logging.Logger LOGGER) throws AccessException
AccessException
public static boolean validateHmacShaSalt(byte[] key, java.lang.String inputHash, java.lang.String data, Utils.HMACHashingAlgo algo, java.util.logging.Logger LOGGER) throws AccessException
key
- inputHash
- data
- AccessException
public static byte[] getAgentHashKey(java.lang.String id, java.util.logging.Logger logger, byte[] sharedSecret) throws java.lang.Exception
id
- java.lang.Exception
public static byte[] getDecryptedSecret(java.lang.String encryptedText, byte[] dccAgentKey, java.util.logging.Logger logger) throws AccessException
AccessException