Created
December 1, 2022 00:07
-
-
Save robherley/e9a5ccd57245c33ebacf6d2a4fdb619a to your computer and use it in GitHub Desktop.
idk man
This file contains hidden or 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
#!/usr/bin/env bash | |
KEY="SOMETHING-$(date -u +%Y-%m-%dT%H:%M:%SZ)" | |
ACCOUNT_KEY="SOMETHING-ELSE" | |
# sign <key> <account key> | |
function sign(){ | |
b64_key=$(echo -n "$2" | base64) | |
payload=$(echo -n "$1" | openssl sha256 -hmac "$b64_key") | |
echo -n "$payload" | base64 | |
} | |
echo key: "$KEY" | |
echo accountkey: "$ACCOUNT_KEY" | |
signed=$(sign "$KEY" "$ACCOUNT_KEY") | |
echo signed: "$signed" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment