Retrieve a GPG key for a given email address from the cli
First run:
$ echo "keyserver hkps://keys.openpgp.org" > .gnupg/gpg.conf
Then to retrieve the GPG key pair with the email address of someone run:
$ gpg --auto-key-locate keyserver --locate-keys email@example.com
Add that command to ~/bin/
as a script:
$ gpg --auto-key-locate keyserver --locate-keys "$@"
Alias that script to:
alias fetch='fetch_gpg_key.sh'
Then you can retrieve a GPG key with:
$ fetch email@example.com
If a key is available, it will be added to your GPG keyring.
Next step would be to run that script automatically from Mutt if the GPG key of the email address isn’t in the keyring and is found on a server.
Source: https://keys.openpgp.org/about/usage
personal computing command-line interface (cli) gnu linux trisquel shell literacy office applications wiki gpg