Sushant Saurav
Sushant Saurav

Reputation: 11

Need to encrypt and decrypt data using RSA XML key in nodejs

I am trying to consume a web service created in C# through nodejs which returns a public RSA XML key to encrypt the parameters and send them back in request.

For example:

<RSAKeyValue><Modulus>c62A/5klhhu5yiqlyE9gwbsnr5PwsCJNC2D3m67pvnqP9nbtQdqRTnf0/ijS2xlo50OpugvDR7qUUD6gY7ptFNogpRQIYpDAC0E+Y977r3vUuRx8XuI6SKjA4IyFXdhYS8wJaQPcqOCpwCKJ3Or5PwdZyl+/HqzmbHIAcrYbRDS=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>

But in nodejs, I am not able to find any module which can encrypt the data directly using RSA XML key.

Instead I have to convert the XML key to PEM using its Modulus and Exponent and encrypt the parameters but I think the web service is not able to decrypt it in that case.

Upvotes: 1

Views: 410

Answers (0)

Related Questions