Need Help with Signing User ID Using Private Key in ServiceNow

DEV 1
Tera Contributor

Title: Need Help with Signing User ID Using Private Key in ServiceNow

Description:

We are attempting to make a REST call to MuleSoft from ServiceNow, and we need to pass the signed User ID in the headers to MuleSoft. To achieve this, we have a certificate and private key in ServiceNow, and we aim to sign the User ID using the private key in ServiceNow scripts.

Here's what we've tried so far:

 

javascript:
var ce = new CertificateEncryption;
var signature = ce.sign("recordID", "alias", "password", "SHA1withRSA", "sign this data");
 

Here's our current setup in the ServiceNow platform:

  • We have uploaded the server certificate .PEM file in the Certificates table.

Below are the parameters we are using for the method:

  • record ID: sys ID of the certificate we uploaded.
  • alias: N/A
  • password: N/A
  • SHA1withRSA: SHA256withRSA
  • sign this data: User ID to sign

However, we are encountering the issue of getting a null signature.

We are unsure about the variables alias and password to pass to the method.

Any assistance or guidance on resolving this issue would be greatly appreciated.

Thank you!

1 REPLY 1

CarmitH
Tera Contributor

Was this solved? I am having the same issue