Can I add an expiration-date to my existing GPG-key?

6

I have a GPG-key. This key is unlimited valid. I thought recently, that this isn't the best idea. That's why my question: Can I add an expiration-date to an existant GPG-key? Or is my only option, to create a new key?

Mnementh

Posted 2010-12-17T23:09:12.347

Reputation: 856

Answers

2

Yes, you can edit it. The process will depend on the software you're using. I use GPGkeys for Windows, where all you have to do is right-click on your private key, and choose edit > expiration date. There is probably a similar method in your software. You can also manually revoke a key at any time.

nhinkle

Posted 2010-12-17T23:09:12.347

Reputation: 35 057

12

If you're doing this from the commandline, you can do it with gpg:-

[andys@daedalus ~]$ gpg --edit-key 0xA762A666

<...>

Command> expire
Changing expiration time for the primary key.
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 10y
Key expires at Mon 14 Dec 2020 23:49:53 GMT
Is this correct? (y/N) y

You need a passphrase to unlock the secret key for
user: "Andy Smith <andy.smith@netprojects.org.uk>"
4096-bit RSA key, ID A762A666, created 2009-05-08

Enter your passphrase, save the key, and you're done. You may want to reupload the key to any keyservers you've previously uploaded the key to as well.

Andy Smith

Posted 2010-12-17T23:09:12.347

Reputation: 691

1Odd, people really love command line so much? (judging from the upvotes) – Pacerier – 2014-02-11T05:46:00.937