Created
August 11, 2023 12:41
-
-
Save xalvarez/e47dd7ebe680f086cd4d64e3984157fb to your computer and use it in GitHub Desktop.
Decrypt text using an AWS KMS key
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
# Decrypt text using an AWS KMS key | |
function kms_decrypt | |
argparse 'm/message=' -- $argv | |
or return | |
if set --query _flag_message | |
echo $_flag_message | aws-encryption-cli --decrypt --wrapping-keys discovery=true --input - --output - --decode -S | jq | |
else | |
printf "Please provide a message using the flag -m" | |
return 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment