expiration date for the keys pgp (automatism)

Werner Koch wk at gnupg.org
Fri Jun 9 14:25:01 CEST 2023

On Mon,  5 Jun 2023 14:49, broussard marc said:

> => does pgp can tell when the key is becoming soon expired?

That is easy on Unix:

  $ gpg --list-keys --with-colons \
    | awk -F: -v days=60 \
      'BEGIN { from=systime(); to=from+(days*86400)};\
       $1=="pub" && $7 > from && $7 < to { found=1 };
       $1=="fpr" && found {found=0; \
          print "key " $10 " expires in the next " days " days"}'

A really proper solution would use a function to decode field 7 because
it may in the future be shown as YYYYMMDDTHHMMSS (actually gpgsm does it
this way).

I will consider to allow the expiration date for the --list-filter which
could then be used on Windows (i.e. w/o awk) as well.



The pioneers of a warless world are the youth that
refuse military service.             - A. Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20230609/f03504f5/attachment.sig>

More information about the Gnupg-users mailing list