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

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

  • SatheshSubramaniam
    SatheshSubramaniam
    17 Posts
    ACCEPTED ANSWER

    Re: Encrypt Decrypt json payloads

    ‏2013-05-23T08:09:14Z  

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

     

    Regards,

    sathesh

  • JoeMorganNTST
    JoeMorganNTST
    427 Posts

    Re: Encrypt Decrypt json payloads

    ‏2013-05-22T22:37:52Z  

    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
    1395 Posts

    Re: Encrypt Decrypt json payloads

    ‏2013-05-23T02:46:20Z  

    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.

     

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

    Regards,

    Steve

  • SatheshSubramaniam
    SatheshSubramaniam
    17 Posts

    Re: Encrypt Decrypt json payloads

    ‏2013-05-23T08:09:14Z  

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

     

    Regards,

    sathesh

  • JoeMorganNTST
    JoeMorganNTST
    427 Posts

    Re: Encrypt Decrypt json payloads

    ‏2013-05-23T15:01:07Z  
    • swlinn
    • ‏2013-05-23T02:46:20Z

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

    Regards,

    Steve

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

  • N K
    N K
    2 Posts

    Re: Encrypt Decrypt json payloads

    ‏2013-05-24T18:48:06Z  

    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.