API Connect

 View Only
  • 1.  RSA Encryption

    Posted Wed May 03, 2023 09:26 AM

    HI Team,

    I want perform RSA encryption/Decryption in API Manager. Can somebody guide me on how to perform this assembly

    BR

    Fahad



    ------------------------------
    Fahad Hassan
    ------------------------------


  • 2.  RE: RSA Encryption

    User Group Leader
    Posted Wed May 03, 2023 02:46 PM

    Hi Fahad, 

    Are you actually looking to perform the encrypt/decrypt in the API assembly? If so, it would run on the gateway, not in the API Manager. 

    Would you be able to provide more details so that I can raise it with the team and try to get you a response as soon as possible. 

    I am looking through other threads to see if anyone has faced this before. 



    ------------------------------
    Gabriel Marte Blanco
    Austin TX
    ------------------------------



  • 3.  RE: RSA Encryption

    Posted Wed May 03, 2023 03:42 PM

    Hi Gabriel,

    Thanks for replying. yes i know it will run on gateway just wanted to mention that i am trying to do this in Assembly of API Manager. My use case is to implement aysmetric encyption/decryption of xml payload and for this i am reaching out for help.

    BR
    Fahad



    ------------------------------
    Fahad Hassan
    ------------------------------



  • 4.  RE: RSA Encryption

    Posted Fri May 05, 2023 03:17 PM

    Hi Fahad...

    If you want to implement asymmetric encryption and decryption in API Assembly, you should use a public key to encrypt and private key to decrypt the payload and vice versa, i,e for example,

    If a consumer is consuming your API then, the consumer should use the public key which you have provided to the consumer(for example, SSL certificate public key) and API Connect as a provider should use the corresponding private key of the matching public certificate to decrypt the XML payload. It can be done using Gatewayscript crypto.createSign() and crypto.createVerify() methods

    If your use case is different, then, please elaborate in detail.



    ------------------------------
    Ashok Beshra
    ------------------------------