1

I'm stumped trying to pass the key parameter to openssl dgst. I'm trying to interface to the GDAX trading platform and each request must be signed by HMAC. They clearly say to

"first base64-decode the alphanumeric secret string (resulting in 64 bytes) before using it as the key for HMAC."

This results in a 64-byte binary string. But the openssl command line program simply says -hmac key meaning that you supply the key as a parameter on the command line, which is fine if it is simple ASCII. But I see no way to supply a binary string of bytes as the key. Is there a way to do this?

(also any general advice about directing GDAX with curl is welcome too)

4

1 回答 1

8

You can specify a binary key in hex format like this:

$ openssl dgst -mac hmac -macopt hexkey:0102030405 myfile
于 2017-12-12T09:24:41.670 回答