Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer
Thanks, that worked! – Mnementh Dec 17 '10 at 23:28

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 <>"
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.

share|improve this answer
Odd, people really love command line so much? (judging from the upvotes) – Pacerier Feb 11 '14 at 5:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .