[prev in list] [next in list] [prev in thread] [next in thread]
List: gnupg-users
Subject: Re: expiration date for the keys pgp (automatism)
From: Steffen Nurpmeso <steffen () sdaoden ! eu>
Date: 2023-06-09 13:24:34
Message-ID: 20230609132434.xS7mR%steffen () sdaoden ! eu
[Download RAW message or body]
Werner Koch wrote in
<875y7wvn4y.fsf@wheatstone.g10code.de>:
|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)};\
Not _that_ easy ("date +%s" maybe, strftime(3) %s is old).
#?2|kent:$ awk 'END{print systime()}' </dev/null
1686316851
#?0|kent:$ mawk 'END{print systime()}' </dev/null
1686316853
#?0|kent:$ nawk 'END{print systime()}' </dev/null
nawk: calling undefined function systime
source line number 1
#?2|kent:$ busybox.static awk 'END{print systime()}' </dev/null
1686316860
| $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.
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
|~~
|..and in spring, hear David Leonard sing..
|
|The black bear, The black bear,
|blithely holds his own holds himself at leisure
|beating it, up and down tossing over his ups and downs with pleasure
|~~
|Farewell, dear collar bear
_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic