public static final class Webhook.Util
extends java.lang.Object
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
computeHmacSha256(java.lang.String key,
java.lang.String message)
Computes the HMAC/SHA-256 code for a given key and message.
|
static long |
getTimeNow()
Returns the current UTC timestamp in seconds.
|
static boolean |
secureCompare(java.lang.String a,
java.lang.String b)
Compares two strings for equality.
|
public static java.lang.String computeHmacSha256(java.lang.String key,
java.lang.String message)
throws java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException
key - the key used to generate the code.message - the message.java.security.NoSuchAlgorithmExceptionjava.security.InvalidKeyExceptionpublic static boolean secureCompare(java.lang.String a,
java.lang.String b)
a - one of the strings to compare.b - the other string to compare.public static long getTimeNow()