Try changing
IntegerString[Hash[StringJoin[opad,ExportString[IntegerDigits[Hash[StringJoin[ipad, message], method], 256],"Binary"]],method],16]
to
Developer`EncodeBase64[
FromCharacterCode[
IntegerDigits[
Hash[
StringJoin[
opad,
ExportString[
IntegerDigits[
Hash[
StringJoin[ipad, message],
"SHA512"
],
256
],
"Binary"
]
],
"SHA512"
],
256
]
]
]
This returns a signature that is Base64 encoded. It's what my API required
Also, I would consider changing all your ExportString[#,{"Base64","String"}] to Developer`EncodeBase64[#]. The ExportString function looks like it adds some formatting to the output.