Package oracle.security.am.asdk
Class Utils
java.lang.Object
oracle.security.am.asdk.Utils
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
getAgentHashKey<wbr>(String id, Logger logger, byte[] sharedSecret)
Generates the key for HMAC Hash for agent payload validationstatic byte[]
getDecryptedSecret<wbr>(String encryptedText, byte[] dccAgentKey, Logger logger)
static String
getHmacShaSalt<wbr>(byte[] key, String data, Utils.HMACHashingAlgo algo, Logger LOGGER)
static boolean
validateHmacShaSalt<wbr>(byte[] key, String inputHash, String data, Utils.HMACHashingAlgo algo, 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
-
Field Details
-
ENCODING_SCHEME
- See Also:
-
HMAC_TOKEN_SEPARATOR
- See Also:
-
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
getHmacShaSalt
public static String getHmacShaSalt<wbr>(byte[] key, String data, Utils.HMACHashingAlgo algo, Logger LOGGER) throws AccessException- Throws:
AccessException
-
validateHmacShaSalt
public static boolean validateHmacShaSalt<wbr>(byte[] key, String inputHash, String data, Utils.HMACHashingAlgo algo, Logger LOGGER) throws AccessExceptionBelow 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- Parameters:
key
-inputHash
-data
-- Returns:
- Throws:
AccessException
-
getAgentHashKey
public static byte[] getAgentHashKey<wbr>(String id, Logger logger, byte[] sharedSecret) throws ExceptionGenerates the key for HMAC Hash for agent payload validation- Parameters:
id
-- Returns:
- Throws:
Exception
-
getDecryptedSecret
public static byte[] getDecryptedSecret<wbr>(String encryptedText, byte[] dccAgentKey, Logger logger) throws AccessException- Throws:
AccessException
-