First, some definitions:
key
: ID, partial name, email<keyId>
: key ID prefixed by0x
About the console: data can be written to GnuPG stdin
just like if it was written in any other console window; to signal that the stream/message is over, hit EOF (Ctrl+D on Linux).
Output can be either binary or ASCII encoded. Binary is the default behavior, and ASCII can be specified by using the option --armor
.
The options are --encrypt
and --decrypt
, and they operate by default reading from stdin
and writting to stdout
.
For encryption is necessary to specify the recipients with --recipient <key>
, since data will be encrypted with their public key:
gpg --recipient <key> --encrypt
Decription is quite simple:
gpg --decrypt
TODO
TODO
Basically all you need is the encrypted message body and:
gpg --decrypt
The decrypted message may now show char combinations instead of non ASCII symbols. If that is the case, and if the message also starts with a header Content-Transfer-Encoding: quoted-printable
, you will need to pipe that into qprint
for decoding of this encoding:
gpg --decrypt | qprint -d
And that's it.
TODO
If you search a keyserver for the ID of a subkey, it will usually return the corresponding master key. However, it wont inform you of that. So, if you search for a key ID and the server returns a different ID, check to see if your query isn't a subkey of the result.