Created
February 25, 2021 07:57
-
-
Save jboero/770501c66cf93c71b1354f8a115c028c to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# Usage: secure-badge.sh [NAME] [YEAR] | |
INPUT=$(echo "$@" | base64) | |
SIG=$(vault write image-verifiers/hmac/svg-signer \ | |
input="$INPUT" -format=json) | |
SIG=$(echo $SIG | jq .data.hmac) | |
SIG="#${SIG:10:8}" | |
sed -i "s/NAME/$1/" template.svg | |
sed -i "s/YEAR/$2/" template.svg | |
sed -i "s/SIGNATURE/$SIG/" template.svg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment