Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.