Skip to content

Instantly share code, notes, and snippets.

@xalvarez
Created August 11, 2023 12:41
Show Gist options
  • Save xalvarez/e47dd7ebe680f086cd4d64e3984157fb to your computer and use it in GitHub Desktop.
Save xalvarez/e47dd7ebe680f086cd4d64e3984157fb to your computer and use it in GitHub Desktop.
Decrypt text using an AWS KMS key
# 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