Package com.stripe.net
Class Webhook.Util
- java.lang.Object
-
- com.stripe.net.Webhook.Util
-
- Enclosing class:
- Webhook
public static final class Webhook.Util extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
computeHmacSha256
public static java.lang.String computeHmacSha256(java.lang.String key, java.lang.String message) throws java.security.NoSuchAlgorithmException, java.security.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:
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
-
getTimeNow
public static long getTimeNow()
Returns the current UTC timestamp in seconds.- Returns:
- the timestamp as a long.
-
-