Hello, I use gnupg with a software I write and it needs a gpg key with expiration date. As I do not myself manage this software, I would like to provide a shell script on Linux (e.g. launched every day with cron) which would check for the expiration date and send a warning if key expires within a given time (15 days for example).
Does there exist an option which would give the expiration date of a key, if such date exists ? I saw nothing on man gpg. It is possible to retrieve the expiration date on Linux with a command line, as shown below, but the command is ugly, not totally safe (because of the grep) and may not work on all versions of gpg. Having these keys : # LANG=C gpg --list-keys /root/.gnupg/pubring.gpg ------------------------ pub 1024D/E5F2C00E 2008-01-12 [expires: 2009-01-11] uid test date (test) <[EMAIL PROTECTED]> sub 2048g/7C17580B 2008-01-12 [expires: 2009-01-11] pub 1024D/16B870A6 2008-01-12 uid aaaaaa (fdsfsd) <[EMAIL PROTECTED]> sub 2048g/B2526B84 2008-01-12 Expiration date of key [EMAIL PROTECTED] is : # LANG=C gpg --list-keys [EMAIL PROTECTED] | grep "\[expires:" | cut -d ":" -f 2 | cut -d " " -f 2 | cut -d "]" -f 1 | head -n 1 2009-01-11 Thanks, Eric LANDES --------------------------------- Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
_______________________________________________ Gnupg-users mailing list Gnupg-users@gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-users