Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need Help with Signing UserID Using Private Key in ServiceNow (SSL, server certificate, private key)

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.

@Ankur Bawiskar @Allen Andreas @Brad Bowman  @Mark Roethof 

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

Thank you!

0 REPLIES 0