Quick ‘n Dirty GPG Key Implementation

by David Sudjiman ~ July 18th, 2005. Filed under: Linux.

I feel like I need to put this tutorial here as I tend to forget things easily. Here’s the quick ‘n dirty GPG key implementation. If you need more explanations, please read Gnu Privacy Guard tutorial, part 1 or www.gnupg.org

Creating GPG key.

  1. Create GPG key.
  2. $gpg --gen-key

  3. Export GPG key to a file.
  4. $gpg --armor --export <UID | Email Address> > <filename.gpg>

  5. Create a revocation certificate key and export to a file.
  6. $gpg --gen-revoke <UID | Email Address> > <filename_revoke.gpg>

  7. Get a list of keyserver in a file to populate your key
  8. $host -l pgp.net | grep wwwkeys

  9. Clean up the list file and start to populate
  10. $for file in $(cat wwwkeys_servers_list.txt); do gpg --keyserver $file --send-keys <UID>; done

Just say that you upgrade your computer and you need to revoke your old GPG key. Make sure you still have filename.gpg and filename_revoke.g
pg
.

  1. Import your previous key
  2. $gpg --import filename.gpg

  3. Import your revocation key to revoke
  4. $gpg --import filename_revoke.gpg

  5. Submit your revoked key to wwwkeys servers to revoke your public key on servers
  6. $for file in $(cat wwwkeys_servers_list.txt); do gpg --keyserver $file --send-keys <UID>; done

  7. Finished revoke your key, do the clean up
  8. $gpg --delete-secret-keys <UID | Email Address>
    $gpg –delete-keys <UID | Email Address>

Note: for pgp.net domain, you don’t have to submit your key to all of the server as they sync each other.

Leave a Reply