Is there a way to do this with the native crypto m...
# suitescript
n
Is there a way to do this with the native crypto module now?
Copy code
function getSignatureKey(key, dateStamp, regionName, serviceName) {
        const kDate = CryptoJS.HmacSHA256(dateStamp, `AWS4${key}`);
        const kRegion = CryptoJS.HmacSHA256(regionName, kDate);
        const kService = CryptoJS.HmacSHA256(serviceName, kRegion);
        return CryptoJS.HmacSHA256('aws4_request', kService);
    }
b
i would expect not,N/crypto is bad with dynamic keys
n
yeah that's what I thought 😕
b
it expects the cryptographic key to be stored in the secret
not computed
n
maybe someday i can get rid of the last bits of cryptojs