HMACSHA1 key encryption issue

PraveenKS
Giga Contributor

Hi Community,

We are facing issue in one of integration we are doing Servicenow with third party,

We need to hash the key using key and body,

we have used below code to hash but everytime we are getting error as "hash value what we got cannot be converted to byte array"

PraveenKS_0-1683282391103.png

 

 

var body = "sample_data";//sample data
var mac = new GlideCertificateEncryption();
var key = "key";


var key = GlideStringUtil.base64Encode(key);
var hash = mac.generateMac(key, 'HmacSHA1',body);

Please anyone help us to solve this issue

 

0 REPLIES 0