diff options
author | Werner Koch <[email protected]> | 2023-03-21 07:36:33 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2023-03-21 07:37:47 +0000 |
commit | 6d21256c9220df05bf92a695a787dde13fe44ca7 (patch) | |
tree | 570e7fb1f55c1308012f52d2a3f34246d0e2eda6 /src | |
parent | Post release updates (diff) | |
download | gpgme-6d21256c9220df05bf92a695a787dde13fe44ca7.tar.gz gpgme-6d21256c9220df05bf92a695a787dde13fe44ca7.zip |
core,cpp: Add new key flags to gpgme_subkey_t
* src/gpgme.h.in (struct _gpgme_subkey): Add bit flags can_renc,
can_timestamp, adn is_group_owned. Reduce size of _unused.
* src/keylist.c (set_subkey_capability): Set them.
* tests/run-keylist.c (main): Print them.
* lang/cpp/src/key.h (Subkey::canRenc): New.
(Subkey::canTimestamp): New.
(Subkey::isGroupOwned): New.
* lang/cpp/src/key.cpp: Implement new methods.
(Subkey::isQualified): Print them.
(std::ostream &operator<<): Print them.
--
GnuPG-bug-id: 6395
Diffstat (limited to 'src')
-rw-r--r-- | src/gpgme.h.in | 11 | ||||
-rw-r--r-- | src/keylist.c | 12 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/gpgme.h.in b/src/gpgme.h.in index 3ea07a81..1d3c1445 100644 --- a/src/gpgme.h.in +++ b/src/gpgme.h.in @@ -575,8 +575,17 @@ struct _gpgme_subkey /* True if the key is compliant to the de-vs mode. */ unsigned int is_de_vs : 1; + /* True if the key can be used for restricted encryption (ADSK). */ + unsigned int can_renc : 1; + + /* True if the key can be used for timestamping. */ + unsigned int can_timestamp : 1; + + /* True if the private key is possessed by more than one person. */ + unsigned int is_group_owned : 1; + /* Internal to GPGME, do not use. */ - unsigned int _unused : 20; + unsigned int _unused : 17; /* Public key algorithm supported by this subkey. */ gpgme_pubkey_algo_t pubkey_algo; diff --git a/src/keylist.c b/src/keylist.c index 1c01bd42..23b97087 100644 --- a/src/keylist.c +++ b/src/keylist.c @@ -287,6 +287,18 @@ set_subkey_capability (gpgme_subkey_t subkey, const char *src) subkey->can_authenticate = 1; break; + case 'r': + subkey->can_renc = 1; + break; + + case 't': + subkey->can_timestamp = 1; + break; + + case 'g': + subkey->is_group_owned = 1; + break; + case 'q': subkey->is_qualified = 1; break; |