Created
August 1, 2021 14:29
-
-
Save taf2/d239255de1599d2092c5c3618c622e25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from hashlib import sha1; | |
import hmac; | |
import base64; | |
timestamp = '1350310273' # X-CTM-Time header | |
signature = 'A sample signature from CTM=' # X-CTM-Signature header | |
api_secret_key = 'your-api-key' # your secret key can be found in the account settings | |
msg = '{...}' # request body | |
mac = hmac.new(api_secret_key, timestamp, sha1) | |
mac.update(msg) | |
print base64.b64encode(mac.digest()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment