RE: Using SuiteScript to encrypt a string as JWE

Hi everyone, I have a question regarding JWS and JWE using SuiteScript. Perhaps someone here can help me with their previous experience.

I’m currently working on a script to sign a payload using JWS. After signing, I need to encrypt it using JWE. I was able to accomplish the signing part by referring to an example I found on Stack Overflow, which I believe someone here may have answered.

However, I’m facing a challenge when it comes to using the built-in crypto module to encrypt the JWS payload in a JWE-compliant manner, using encryption algorithms like A256CBC-HS512 or RSA-OAEP-256. I haven’t been able to find a way or an example demonstrating this.

Does anyone here have experience with accomplishing this task? It goes without saying that I’m trying not to include any external library to achieve this.

borgesbruno Rookie Asked on June 15, 2023 in SuiteScript.
Add Comment
5 Answers

No problem. If you download the file, it’s a straightforwards as:


require(['./crypto-js'], function(CryptoJS) {
Intermediate Answered on June 16, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.