'Building a Digest Header for API request
i've been struggling to wrap my head around something - https://datatracker.ietf.org/doc/html/rfc3230#section-4.3.2 I'm trying to learn more about the API in general
To calculate the digest, you must do the following:
"SHA-512=" + Base64(SHA512(payload) For an empty string, the output should be "SHA-512=z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg=="
I tried to do this for the empty payload but never came to the same conclusion.. Do I need to add something into the computation? RFC 3230 - Instance Digests in HTTP ... Instance Digests in HTTP (RFC 3230) In the documentation I have explaining this example, we have this:
raw_payload = "{\"data\":{\"type\":\"customerAccessToken\",\"attributes\":{\"applicationCustomerReference\":\"15874569\"}}}"
digest = "SHA-512=" + BASE64(SHA512(raw_payload)
=> "SHA-512=z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg=="
Do I need to add something to the calculation instead of the just the empty string? When I try to follow the example, the result is completely different - this is a calculation with an empty body. Any help would be greatly appreciated :slight_smile:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
