From adadfac997a812699049cd9a5f484cbcabff5bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Wed, 15 May 2024 10:31:46 +0200 Subject: core: Add information about revocation keys to keys * src/gpgme.h.in (struct _gpgme_revocation_key, gpgme_revocation_key_t): New. (struct _gpgme_key): Add fields 'revkeys', '_last_revkey'. * src/key.c (_gpgme_key_add_rev_key): New. (gpgme_key_unref): Free revkeys. * src/keylist.c (keylist_colon_handler): Parse rvk lines. * src/ops.h (_gpgme_key_add_rev_key): New. * tests/run-keylist.c (main): Print revocation key info. -- GnuPG-bug-id: 7118 --- src/gpgme.h.in | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/gpgme.h.in') diff --git a/src/gpgme.h.in b/src/gpgme.h.in index c8eba0a5..eaeb22aa 100644 --- a/src/gpgme.h.in +++ b/src/gpgme.h.in @@ -763,6 +763,28 @@ struct _gpgme_user_id typedef struct _gpgme_user_id *gpgme_user_id_t; +/* A designated revocation key for a key. + * This structure shall be considered read-only and an application + * must not allocate such a structure on its own. */ +struct _gpgme_revocation_key +{ + struct _gpgme_revocation_key *next; + + /* The public key algorithm of the revocation key. */ + gpgme_pubkey_algo_t pubkey_algo; + + /* The fingerprint of the revocation_key in hex digit form. */ + char *fpr; + + /* The class of the revocation key. */ + unsigned int key_class; + + /* True if the revocation key should not be exported. */ + unsigned int sensitive : 1; +}; +typedef struct _gpgme_revocation_key *gpgme_revocation_key_t; + + /* A key from the keyring. * This structure shall be considered read-only and an application * must not allocate such a structure on its own. */ @@ -860,6 +882,12 @@ struct _gpgme_key /* Time of the last refresh of the entire key. 0 if unknown. */ unsigned long last_update; + + /* The revocation keys of the key. */ + gpgme_revocation_key_t revocation_keys; + + /* Internal to GPGME, do not use. */ + gpgme_revocation_key_t _last_revkey; }; typedef struct _gpgme_key *gpgme_key_t; -- cgit v1.2.3