Package com.stripe.net
Class Webhook.Util
java.lang.Object
com.stripe.net.Webhook.Util
- Enclosing class:
- Webhook
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
computeHmacSha256
(String key, String message) Computes the HMAC/SHA-256 code for a given key and message.static long
Returns the current UTC timestamp in seconds.
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
computeHmacSha256
public static String computeHmacSha256(String key, String message) throws NoSuchAlgorithmException, InvalidKeyException Computes the HMAC/SHA-256 code for a given key and message.- Parameters:
key
- the key used to generate the code.message
- the message.- Returns:
- the code as a string.
- Throws:
NoSuchAlgorithmException
InvalidKeyException
-
getTimeNow
public static long getTimeNow()Returns the current UTC timestamp in seconds.- Returns:
- the timestamp as a long.
-