Monday, July 16, 2007

Changing expirery date of a gpg key

# gpg --list-keys
/root/.gnupg/pubring.gpg
------------------------
pub 1024D/0638309A 2005-06-29 Groupe Unix (no comment) <xxxx@xxxx.com>
sub 2048g/A50FAD76 2005-06-29 [expires: 2006-06-29]

# gpg --edit-key "Groupe Unix"
gpg (GnuPG) 1.2.1; Copyright (C) 2002 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

Secret key is available.

pub 1024D/0638309A created: 2005-06-29 expires: 2006-06-29 trust: -/e
sub 2048g/A50FAD76 created: 2005-06-29 expires: 2006-06-29
(1). Groupe Unix (no comment) <xxxx@xxxx.com>

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)
Key does not expire at all
Is this correct (y/n)? y

You need a passphrase to unlock the secret key for
user: "Groupe Unix (no comment) <xxxx@xxxx.com>"
1024-bit DSA key, ID 0638309A, created 2005-06-29


pub 1024D/0638309A created: 2005-06-29 expires: never trust: -/-
sub 2048g/A50FAD76 created: 2005-06-29 expires: 2006-06-29
(1). Groupe Unix (no comment) <xxxx@xxxx.com>

Command> key 1

pub 1024D/0638309A created: 2005-06-29 expires: never trust: -/-
sub* 2048g/A50FAD76 created: 2005-06-29 expires: 2006-06-29
(1). Groupe Unix (no comment) <xxxx@xxxx.com>

Command> expire
Changing expiration time for a secondary 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)
Key does not expire at all
Is this correct (y/n)? y

You need a passphrase to unlock the secret key for
user: "Groupe Unix (no comment) <xxxx@xxxx.com>"
1024-bit DSA key, ID 0638309A, created 2005-06-29


pub 1024D/0638309A created: 2005-06-29 expires: never trust: -/-
sub* 2048g/A50FAD76 created: 2005-06-29 expires: never
(1). Groupe Unix (no comment) <xxxx@xxxx.com>

Command> quit
Save changes? yes
root@spco1dpt1:/root/.gnupg
# gpg --list-keys
/root/.gnupg/pubring.gpg
------------------------
pub 1024D/0638309A 2005-06-29 Groupe Unix (no comment) <xxxx@xxxx.com>
sub 2048g/A50FAD76 2005-06-29