App Connect

 View Only
  • 1.  JSON Payload with JSON Array needs to be encrypted in AES

    Posted 15 days ago
    Dear Team,

    I need to encrypt the whole json payload and the json structure has multiple arrays, I need to encrypt the body using AES algorithm.

    When the request reaches app connect the json array has changed to Item json object . From ESQL I am  converting the Input message to character and calling procedure of JAVA class for AES encryption.

    In Java class the input request will be in the ITEM tag instead of an array[].So while encryption we cant able to encrypt the exact request message..Is there any way that the array request coming in app connect as [] instead of ITEM and pass the same to java class.

    Please help on this scenario. Waiting for your response.

    Original request:
    {
    "data": [
    {

    "cgpan": "CG20150337420TC",
    "npadate": "2020-12-29 00:00:00.000",
    "npacgtsireportingflag": "N"
    },
    {
    "cgpan": "CG20150337420TC",
    "npadate": "2020-12-29 00:00:00.000",
    "npacgtsireportingflag": "N"
    }
    ]
    }
    App connect request:
    {
    "data": {
    "Item":
    {

    "cgpan": "CG20150337420TC",
    "npadate": "2020-12-29 00:00:00.000"}},
    {
    "Item":
    {
    "cgpan": "CG20150337421TC",
    "npadate": "2020-12-29 00:00:00.000"}}}



    Thanks and regards,
    Hari Prasanth S

    ------------------------------
    Hari Prasanth
    ------------------------------


  • 2.  RE: JSON Payload with JSON Array needs to be encrypted in AES

    Posted 10 days ago
    The Item is part of how JSON Arrays are represented internally in the JSON parser; each element in the array is first an Item, which then contains whatever the JSON element contains.

    So to encrypt properly, you either need to make the Java code understand this structure, OR you can serialize the bits you want encrypted back into String/CHAR representations and pass those to Java to be encrypted.

    I wrote something a while back which may help:  https://community.ibm.com/community/user/integration/blogs/tony-hays1/2021/05/24/encrypting-part-of-a-payload-in-iib

    I showed serializing what I wanted to encrypt into Environment; the Java code looked there for what to encrypt.

    ------------------------------
    Tony Hays
    Senior IT Architect
    IBM Global Services
    Spokane WA
    706-305-8487
    ------------------------------