To summarize my problem, I want to adapt an encryption algorithm written in Javascript to the Java side. The content produced here is used in the header of the service I am calling. But even though I have tried many ways, I have not been able to find the real algorithm yet. The algorithm written in Javascript is as follows:
Tag: hmac
WebCrypto JS SHA256 HMAC Mismatch
I have two scripts that generate a SHA256 HMAC, with a plaintext message and Base64 encoded key. One is written in PHP and the other in JavaScript. The PHP script returns the correct HMAC, but for some reason the JS version does not. What is causing this? Here are the code samples, with a redacted (still similar in nature) key.