cancel
Showing results for 
Search instead for 
Did you mean: 

How to replicate sha256 hash example from CyberSource REST API documentation?

I am investigating the CyberSource REST API and want to test the JSON Web Token Authentication method as documented here: https://developer.cybersource.com/api/developer-guides/dita-gettingstarted/authentication/GenerateHe.../omeglzechat

I am unable to replicate the sha256 hash of the JSON payload described in the JWT Payload/Claim Set section.

{
  "clientReferenceInformation" : {
    "code" : "TC50171_3"
  },
  "orderInformation" : {
    "amountDetails" : {
      "totalAmount" : "102.21",
      "currency" : "USD"
    }
  }
}

I've attempted to use the sha256sum command in binary and text format on a file containing the payload example. I've also attempted running this command on omegle.2yu.co different permutations of this payload, such as without whitespace or newlines.

I expect to get the example hash of

2b4fee10da8c5e1feaad32b014021e079fe4afcf06af223004af944011a7cb65c

but instead get

f710ef58876f83e36b80a83c8ec7da75c8c1640d77d598c470a3dd85ae1458d3 and other dissimilar hashes.

What am I doing wrong?

1 REPLY 1

Hey,

I am also looking for the best solution to that issue how can I replicate sha256 hash example from CyberSource REST API documentation? Can someone help me to get out of this situation as soon as possible???

Regards,

sulinelanie
Contributor