Encrypt and Decrypt the payload (JSON format) at ServiceNow end in integration.

harikaravur
Tera Contributor

Hi,

 

We would like to know if we can encrypt and decrypt the message (JSON payload) which we will be sending and receiving from ServiceNow to Pulsar and vice versa. Can anyone please suggest if there is a way that we can achieve this.

 

Thanks!

4 REPLIES 4

Daniel Borkowi1
Mega Sage

Hi @harikaravur, you can use JSON API.

 

var obj = {
  test: "test",
  attribute: "Hello World"
};

//Encode to JSON 
var payload = JSON.stringify(obj);
gs.log(payload); // prints:  {"test":"test","attribute":"Hello World"}

//Decode JSON to Object
var decoded_obj = JSON.parse(payload);

gs.log(decoded_obj .attribute); // prints: Hello World

Greets
Daniel

Please mark reply as Helpful/Correct, if applicable. Thanks!

 

Hi Daniel,

 

We are looking for key based encryption and decryption so that we can send and receive data from pulsar. Pulsar will be sending encrypted message which needs to be decrypted, and we need to encrypt the data to send, Pulsar.

That's interesting, that means there is an additional encryption to the https encryption. Do you have the Encryption Key?  Is it already stored in your Key Management Module? If yes you can use the KMFCryptoOperation API.

 

Greets
Daniel

Please mark reply as Helpful/Correct, if applicable. Thanks!

 

 

Hello @harikaravur ,

 

Do you find any answer regarding encrypt and decrypt of request and response in REST Integration.

 

If yes, Please help me as I have to implement that as well.

 

Regards,

Mahesh Sonawane