aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin H. Johnson via Gnupg-devel <[email protected]>2023-09-02 16:59:43 +0000
committerWerner Koch <[email protected]>2023-09-15 08:37:47 +0000
commitbf662d0f93af7524fff79116f7917d22f0259793 (patch)
tree4f332dd97260836f9ac04fc65c376ff972912be0
parentdirmngr: Relax the detection of the "none" keyserver. (diff)
downloadgnupg-bf662d0f93af7524fff79116f7917d22f0259793.tar.gz
gnupg-bf662d0f93af7524fff79116f7917d22f0259793.zip
gpg: Add --list-filter properties sig_expires/sig_expires_d
Modelled after key_expires/key_expires_d. This should be useful to detect upcoming certification expiry, so the certifications can be renewed in advance of the expiry. Signed-off-by: Robin H. Johnson <[email protected]>
-rw-r--r--doc/gpg.texi6
-rw-r--r--g10/import.c14
2 files changed, 20 insertions, 0 deletions
diff --git a/doc/gpg.texi b/doc/gpg.texi
index ce72afbf5..b666a72bc 100644
--- a/doc/gpg.texi
+++ b/doc/gpg.texi
@@ -2715,6 +2715,12 @@ The available properties are:
second is the same but given as an ISO date string,
e.g. "2016-08-17". (drop-sig)
+ @item sig_expires
+ @itemx sig_expires_d
+ The expiration time of a signature packet or 0 if it does not
+ expire. The second is the same but given as an ISO date string or
+ an empty string e.g. "2038-01-19".
+
@item sig_algo
A number with the public key algorithm of a signature packet. (drop-sig)
diff --git a/g10/import.c b/g10/import.c
index d84a083cc..c1e76c3f0 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -1509,6 +1509,20 @@ impex_filter_getval (void *cookie, const char *propname)
{
result = dateonlystr_from_sig (sig);
}
+ else if (!strcmp (propname, "sig_expires"))
+ {
+ snprintf (numbuf, sizeof numbuf, "%lu", (ulong)sig->expiredate);
+ result = numbuf;
+ }
+ else if (!strcmp (propname, "sig_expires_d"))
+ {
+ static char exdatestr[MK_DATESTR_SIZE];
+
+ if (sig->expiredate)
+ result = mk_datestr (exdatestr, sizeof exdatestr, sig->expiredate);
+ else
+ result = "";
+ }
else if (!strcmp (propname, "sig_algo"))
{
snprintf (numbuf, sizeof numbuf, "%d", sig->pubkey_algo);