Topic
5 replies Latest Post - ‏2013-05-24T18:48:06Z by N K
N K
N K
2 Posts
ACCEPTED ANSWER

Pinned topic Encrypt Decrypt json payloads

‏2013-05-22T14:33:36Z |

Has anyone tried encrypting or decrypting JSON payloads on Datapower. I am running firmware 5. Can't seem to find an option. encrypt-string() extension function could be a way, but has anyone tried it?

 

NK

  • JoeMorganNTST
    JoeMorganNTST
    210 Posts
    ACCEPTED ANSWER

    Re: Encrypt Decrypt json payloads

    ‏2013-05-22T22:37:52Z  in response to N K

    Yes, I am.  I'm using encrypt-string(), decrypt-data() using a 256 AES key I generated with Open SSL.

    First, I convert the JSON using the convert-parms action.  Then pull out and encrypt what I need to encrypt.  Then I put it all back together with an XLST.

    There might be a better way in the put-together... but I don't know the reverse of the convert-parms action to take the xml version of JSON and turn it back into true JSON.

     

    • swlinn
      swlinn
      1327 Posts
      ACCEPTED ANSWER

      Re: Encrypt Decrypt json payloads

      ‏2013-05-23T02:46:20Z  in response to JoeMorganNTST

      There is a stylesheet, store:///jsonx2json.xsl to convert JSONX to JSON..

      Regards,

      Steve

      • JoeMorganNTST
        JoeMorganNTST
        210 Posts
        ACCEPTED ANSWER

        Re: Encrypt Decrypt json payloads

        ‏2013-05-23T15:01:07Z  in response to swlinn

        And here I was looking for a special action.... Go Figure! 

  • SatheshSubramaniam
    SatheshSubramaniam
    11 Posts
    ACCEPTED ANSWER

    Re: Encrypt Decrypt json payloads

    ‏2013-05-23T08:09:14Z  in response to N K

    we can use crypto binary action in advanced for performs non-XML specific cryptographic operations on input message.

     

    Regards,

    sathesh

  • N K
    N K
    2 Posts
    ACCEPTED ANSWER

    Re: Encrypt Decrypt json payloads

    ‏2013-05-24T18:48:06Z  in response to N K

    Thanks for your feedback.

    I went with the crypto binary action as I had to encrypt the whole payload. It was my last resort anyway.

    If I were to encrypt specific parts, I would have to convert it to JSONX and use some XSLT.