--- title: "GPG: Revalidate expired key and add new email account" date: 2014-07-05T11:57:04Z draft: false tags: [ "sysadmin" ] image: Email-with-lock.jpg ---

When you are creating a new GPG key you have to decide how long the key will be valid before to renew. In my case when I got my own key, I was not really thinking on use it daily, it was years ago, just for test and have fun.

Nowadays I'm giving GPG a second - and more professional - chance, so when I tried to configure the key in client I realize that it was expired. How could I do to revalidate it?. Dunno if this is the oficial way, but it works for me:

``` $ gpg --edit-key A0YOURK3Y gpg> list gpg> key 0 gpg> expire Changing expiration time for the primary key. Please specify how long the key should be valid. Key is valid for? (0) 2y Key expires at 06/06/16 08:51:25 Is this correct? (y/N) y gpg> save ```

At this time we have to send the update to public servers:

``` $ gpg --keyserver pgp.mit.edu --send-keys A0YOURK3Y ```

From the time I've created the key until now I've changed my main email account, so other of my main goals is to add the new email account to the key:

``` $ gpg --edit-key A0YOURK3Y gpg> adduid Name: Óscar Email: new@emailaccount.com Comment: This is my superb and new email account gpg> save ```

We have to send the update to the public servers again:

``` $ gpg --keyserver pgp.mit.edu --send-keys A0YOURK3Y ```

And that's all, now it's time to see how to properly use it from an email client, new story.