Package com.stripe.net
Class Webhook.Util
java.lang.Object
com.stripe.net.Webhook.Util
- Enclosing class:
- Webhook
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcomputeHmacSha256(String key, String message) Computes the HMAC/SHA-256 code for a given key and message.static longReturns 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:
NoSuchAlgorithmExceptionInvalidKeyException
-
getTimeNow
public static long getTimeNow()Returns the current UTC timestamp in seconds.- Returns:
- the timestamp as a long.
-