
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2019 11:35 AM
I am working on a JIRA integration from Servicenow and the authentication I want to use is oAuth 1.0. As servicenow doesnt support oAuth 1.0, I am writing custom code to make it work.
I have the access token, consumer id etc, and I am trying to generate a signature, with a private key and a string I have.
Is there a function which can generate the signature using RSA-SHA1 algorithm?
I know I can generate the HMAC SHA1, but RSA-SHA1 is not supported
var mac = new CertificateEncryption();
var signature = mac.generateMac(pkey, "RSA-SHA1", signatureBaseString);
Please mark this response as correct or helpful if it assisted you with your question.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2019 10:24 PM
Yes. I had a certificate which was in pkcs8 format. I converted it to pkcs12 format and loaded it in sys_certificate table. Once you do that, use below function, which will generate the signature.
var ce = new CertificateEncryption(); ce.sign("sysid of the certificate", "1", "", "SHA1withRSA", "datastring");
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2019 12:25 PM
Anyone?
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2019 08:23 PM
Hey mate,
Did you manage to find out a solution for your problem? Appreciate any feedback.
I have a similar problem and would love to hear from you.
TIA

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2019 10:24 PM
Yes. I had a certificate which was in pkcs8 format. I converted it to pkcs12 format and loaded it in sys_certificate table. Once you do that, use below function, which will generate the signature.
var ce = new CertificateEncryption(); ce.sign("sysid of the certificate", "1", "", "SHA1withRSA", "datastring");
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2020 10:08 PM
This is exactly what I'm looking for! Thanks for providing. The only issue I'm seeing is an error in the logs... "CertificateEncryption" is not defined.
I tried with and without the () at the end of CertificateEncryption.
var ce = new CertificateEncryption();
ce.sign("8cb02fa5db971850a80f5716f496197f", "", "password", "SHA1withRSA", "sign this data");
var ce = new CertificateEncryption;
ce.sign("8cb02fa5db971850a80f5716f496197f", "", "password", "SHA1withRSA", "sign this data");
How does one use this in the Global Scope?