Importing PGP keys

It seems a lot of people think that it's a hassle to import pgp keys, this is proof that they're wrong.

Importing a pgp key from stdin

A lot of people share their pgp keys in cleartext (armored) format, like 20h.

On the bottom of the about page, his public key is available in cleartext.

Now that we've found a pgp key, how do we import it via gpg?

gpg --import
# paste key
Version: GnuPG v1.4.11 (GNU/Linux)

# we end it with ^D (EOF)
gpg: key 09A9CB55: public key "Christoph Lohmann <>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

And that's it.

You could also pipe it from curl as such;

curl -sL https://unix-fan.tld/ | gpg --import

Downloading from a keyserver

Not everyone has a website, or keep their public keys there, that's when keyservers come into play.

gpg has support for fetching keys from keyservers. Wow what a shock, GNU is totally not known for bloat[!]

A keyserver, like, lets users store their pgp keys online, and for people to easily retrieve them.

Assuming you're using the default config, importing keys from a keyserver is as simple as;

gpg --search-keys z3bra
gpg: searching for "z3bra" from hkp server the.key.serv.tld
(1) Willy Goiffon (z3bra) <>
      4096 bit RSA key BD00B46C, created: 2013-07-03
Keys 1-1 of 1 for "z3bra".  Enter number(s), N)ext, or Q)uit >

Then it's as easy as selecting the key you want, and gpg will import it.

Exporting your key

To export your key, run;

gpg -a --export >

Then you can move to https://your.tld/ or upload it to any keyserver.