A strange one. Can we call a JAR executable from Netsuite ? Need it to generate a Digital Signature
s
scottvonduhn
06/24/2020, 1:26 PM
Even though NetSuite runs all custom code in the server using a JVM, I do not think they would ever allow anyone to execute arbitrary Java byte code, whether through a JAR or compiled class.
What is this digital signature needed for? Is it not possible to generate it using JavaScript?
s
Simon
06/24/2020, 1:29 PM
Walmart want us to generate a digital signature. Here is what is required
Simon
06/24/2020, 1:29 PM
1. Decode the byte array with Base-64.
2. Encode the resulting value using PKCS#8 to represent your Private Key.
3. Libraries in various languages offer the ability to identify that the Private Key is in PKCS#8 format and not in other conflicting formats such as PKCS#1.
4. Use this byte representation of the Private Key to sign the data using SHA-256 with RSA.
5. Encode the generated digital signature using Base 64.
Simon
06/24/2020, 1:29 PM
It looks that it's not possible in Netsuite/Javascript
s
scottvonduhn
06/24/2020, 1:41 PM
You may need to use an intermediate or auxiliary service, to either add the digital signature to what you are sending to Walmart, before passing it along, or to generate the digital signature from a GET or POST request, that you can call and then use the generated signature within your SuiteScript.
👍 2
e
Eric B
06/24/2020, 2:28 PM
I created a web service to generate this signature. You pass your payload to the web service and then it returns your signature which you can use in your script.