From b63d203d3ba49483b079fb118a90990c452cd232 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 5 Oct 2023 14:10:01 +0200 Subject: core: Add key capability flags has_encrypt etc. * src/gpgme.h.in (struct _gpgme_key): Add flags has_encrypt, has_certify, has_sign, and has_authenticate. * src/keylist.c (finish_key): Set these flags. * tests/run-keylist.c (main): Print them. -- GnuPG-bug-id: 6748 --- doc/gpgme.texi | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/gpgme.texi b/doc/gpgme.texi index bce1b163..8c6420e6 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -3461,22 +3461,47 @@ listings if the key could not be validated due to missing certificates or unmatched policies. @item unsigned int can_encrypt : 1 -This is true if the key (ie one of its subkeys) can be used for -encryption. +This is true if the key or one of its subkeys can be used for +encryption and the encryption will likely succeed. @item unsigned int can_sign : 1 -This is true if the key (ie one of its subkeys) can be used to create -data signatures. +This is true if the key or one of its subkeys can be used to create +data signatures and the signing will likely succeed. @item unsigned int can_certify : 1 -This is true if the key (ie one of its subkeys) can be used to create +This is true if the key or one of its subkeys can be used to create key certificates. @item unsigned int can_authenticate : 1 @since{0.4.5} This is true if the key (ie one of its subkeys) can be used for -authentication. +authentication and the authentication will likely succeed. + +@item unsigned int has_encrypt : 1 +@since{1.23.0} + +This is true if the key or one of its subkeys is capable of encryption. +Note that this flag is set even if the key is expired. + +@item unsigned int has_sign : 1 +@since{1.23.0} + +This is true if the key or one of its subkeys is capable of signing. +Note that this flag is set even if the key is expired. + +@item unsigned int has_certify : 1 +@since{1.23.0} + +This is true if the key or one of its subkeys is capable of signing. +Note that this flag is set even if the key is expired. + +@item unsigned int has_authenticate : 1 +@since{1.23.0} + +This is true if the key or one of its subkeys is capable of +authentication. Note that this flag is set even if the key is +expired. @item unsigned int is_qualified : 1 @since{1.1.0} -- cgit v1.2.3