Skip to content

Instantly share code, notes, and snippets.

Created July 13, 2020 17:01
What would you like to do?
// Define the signing key in base64
var kSigningB64 = CryptoEncoding.hexToBase64(attSigningKey);
System.log("The signing key in base64 is: " + kSigningB64);
// Define the string to sign in base 64
var stringToSignB64 = CryptoEncoding.base64Encode(attStringToSign);
System.log("The string to sign in base64 is: " + stringToSignB64);
// Calculate the signature
var signature = CryptoDigest.hmacSha256(kSigningB64, stringToSignB64);
attSignature = CryptoEncoding.base64toHex(signature);
System.log("The signature is: " + attSignature);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment