Kraken API MATLAB client invalid signature error

前端 未结 1 1488
你的背包
你的背包 2021-01-23 20:28

I\'m trying to do some authenticated calls to Kraken private endpoints but without success. I\'m still getting an error EAPI:Invalid signature. Does anybody know what\'s wrong?<

相关标签:
1条回答
  • 2021-01-23 21:03

    The problem is in function crypto here:

    keyStr = java.lang.String(key);
    key = SecretKeySpec(keyStr.getBytes('UTF-8'), algorithm);
    

    As the base64 encoded private key from kraken is not necessarily UTF-8 encoded, you cannot use UTF-8 encoding to extract the key and pass UTF-8 string to the SecretKeySpec function. You need to use byte array instead.

    Similar issues

    https://code.google.com/p/google-apps-script-issues/issues/detail?id=5113 https://code.google.com/p/google-apps-script-issues/issues/detail?id=3121

    Solution for javascript

    github.com/Caligatio/jsSHA

    0 讨论(0)
提交回复
热议问题