I'm using a specification document for accessing API, and it says that hash is calculated on the signature generated from the following logic:
Signature = (field1 + field2 + field3 + field4 + field5 + field6) + (field7 + field8)
I'm just wondering what does this mean?
So, when I concatenate the fields and hash using sha-256, I'm getting a different hash format than the expected 32 byte; a sample hash has this format:
PajZG3NEUUHgrycwtPKcKkvTdBg/Kkx6OhlULgSV+ko= as opposed to this example:
c7477242d3901f537387b2b6c61099380634c013a060960a5bf4d87734d54f0e
This is my code:
stringToHash = "field1field2field3field4field5field6field7field8";
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] hash = digest.digest(stringToHash.getBytes(StandardCharsets.UTF_8));
String encoded = Base64.getEncoder().encodeToString(hash);
What could I be missing?