Thanks for the reply Hermann
Below is the process for decrypting the data for this aes encrypted key
1.decode the base64 data of aes Encrypted key
2.decrypt the the aes encrypted key with RSA keys
when i decode the base64 data i am getting the decoded data like below
)í¦&÷è¬në=ô¤ÆÃÓeôÞ«ôÞøK^.Qu3XøwwP%úV
"|wÿ̱§V®çüMX=O¦¦ÝþZãl_Z¹¦CÈE"è9¡1rgâ¹÷ç7aÛx*;Li"eülDò»ÆÝCmò«)6óºúÌûÕ¶+¨ÀÅÚ¢%Y8 $|Má¶«eÉØK.ÿå`«_õApÐê,8ÀùüSpµÛè%¼ßLsUä]Ä�ú¾R0sݽál÷ª�%J
6SUE·eÕ6K;²sÛ×ùZ!->¿ÓÞñý#Ò:¶Ë±W
since it is not utf8 , xslt is throwing the error . invalid based 64 data .
we don't have this problem in NodeJS because we are using Buffer.from(encryptedaeskey,'base64') which is taking as buffer data and we are able to handle this .
I am looking for similar concept to make it work on Datapower
------------------------------
santhosh
------------------------------
Original Message:
Sent: Mon July 06, 2020 11:49 AM
From: santhosh yelimineti
Subject: dp:decrypt-key in Gateway Script
Hi
I have tried using dp:decrypt-key function with rsa aes encrypted key .
as per the client requirement , it has to be decoded first and then decrypt the aes key.
1. Used dp:decode and also dp:binary-code function . It always complains not valid base64 content
2. dp:decrypt-key always gives me rsa decryption failed
I have used the same encrypted aes key in NodeJS , i am able to decrypt it successfully
I have passed the aeskey encrypted key as buffer object in privateDecrypt function.
Do we have any dp:decrypt-key function in Gateway Script ?..
------------------------------
santhosh
------------------------------