Hello everyone, We are trying to achieve RESTlet ...
# integrations
s
Hello everyone, We are trying to achieve RESTlet encyption - decryption for the request - response objects. In suitescript 1.0 we are able to do it via nlapiencypt - nlapidecrypt and is working fine. Requirement is to have it done via Suitescript 2.0..I tried using CryptoJS library which works well..but similar thing we need using N/crypto library..There’s a sample code in suiteAnswer which have a suitelet approach (which requires secret key field and a chuck of string entered in UI will be encypted- decrypted) but we don’t want that..Has anyone accomplished it in the past using any other approach with SuiteScript 2.0?
b
you want to use the secret key
nlapiencrypt and nlapidecrypt was basically using a secret key you have no control over
s
@battk : I need to have encryption in Suitescript 2.0 RESTlet wherein if external system hits the RESTlet, we should send JSON response in encrypted form.. Is there any way to do this ?
b
use the cipher related methods of N/crypto
s
I found one suitelet approach till now for achieving this which requires some UI element fields..it can’t be backend suitelet under N/crypto
b
it sounds like you are talking about Form.addSecretKeyField, which is one of the methods required store a secret in netsuite
the other is Secrets Management
either method can be eventually used with N/crypto ciphers
storing secrets is basically something you only do once
s
Thanks much @battk .. It actually worked