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 /lang/cpp | |
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 'lang/cpp')
-rw-r--r-- | lang/cpp/src/key.cpp | 18 | ||||
-rw-r--r-- | lang/cpp/src/key.h | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/lang/cpp/src/key.cpp b/lang/cpp/src/key.cpp index 293c9e5b..b7a55aec 100644 --- a/lang/cpp/src/key.cpp +++ b/lang/cpp/src/key.cpp @@ -515,6 +515,21 @@ bool Subkey::canAuthenticate() const return subkey && subkey->can_authenticate; } +bool Subkey::canRenc() const +{ + return subkey && subkey->can_renc; +} + +bool Subkey::canTimestamp() const +{ + return subkey && subkey->can_timestamp; +} + +bool Subkey::isGroupOwned() const +{ + return subkey && subkey->is_group_owned; +} + bool Subkey::isQualified() const { return subkey && subkey->is_qualified; @@ -1261,7 +1276,10 @@ std::ostream &operator<<(std::ostream &os, const Subkey &subkey) << "\n canEncrypt: " << subkey.canEncrypt() << "\n canCertify: " << subkey.canCertify() << "\n canAuth: " << subkey.canAuthenticate() + << "\n canRenc: " << subkey.canRenc() + << "\n canTimestanp: " << subkey.canTimestamp() << "\n isSecret: " << subkey.isSecret() + << "\n isGroupOwned: " << subkey.isGroupOwned() << "\n isQualified: " << subkey.isQualified() << "\n isDeVs: " << subkey.isDeVs() << "\n isCardKey: " << subkey.isCardKey() diff --git a/lang/cpp/src/key.h b/lang/cpp/src/key.h index 09f1879f..787cb43e 100644 --- a/lang/cpp/src/key.h +++ b/lang/cpp/src/key.h @@ -270,6 +270,9 @@ public: bool canSign() const; bool canCertify() const; bool canAuthenticate() const; + bool canRenc() const; + bool canTimestamp() const; + bool isGroupOwned() const; bool isQualified() const; bool isDeVs() const; bool isCardKey() const; |