nl_tokens: This function decrypts and parses an encrypted response body sent by APIM The body must be in the following format :
pl_tokens: function decryptAPIMResponse ( body , private_key ) { if ( ! <mask> . key || ! body . cipher ) { throw new Error ( 'bad handshake response from APIm' ) ; } var key = crypto . privateDecrypt ( { key : private_key , padding : constants . RSA_PKCS1_PADDING } , new Buffer ( body . key , 'base64' ) ) ; var iv = new Buffer ( 16 ) ; iv . fill ( 0 ) ; var decipher = crypto . createDecipheriv ( 'aes-256-cbc' , key , iv ) ; var plainText = decipher . update ( body . cipher , 'base64' , 'utf8' ) ; plainText += decipher . final ( 'utf8' ) ; log . debug ( 'handshake response payload:' , plainText ) ; return JSON . parse ( plainText ) ; }