Reputation: 1179
I'm integrating NetSuite with custom serverless application running on AWS. The application uses AWS Cognito for authentication. I received NodeJS code from application developer and I was refactoring it to run in NetSuite using SuiteScript 2.1 moduled. I hit a brick wall when I got to HMACs.
I'm trying to implement following line which uses NodeJS crypto
package const kDate = crypto.createHmac('sha256', Buffer.from('AWS4' + key, 'utf8')).update(dateStamp).digest();
let _sKey = https.createSecretKey({
encoding: https.Encoding.UTF_8,
secret: ('AWS4' + key)
});
let _kDate = crypto.createHmac({
algorithm: crypto.HashAlg.SHA256,
key: _sKey
});
_kDate.update({
input: dateStamp
});
const kDate = _kDate.digest({outputEncoding: encode.Encoding.UTF_8});
Upvotes: 0
Views: 14