From 6d21256c9220df05bf92a695a787dde13fe44ca7 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 21 Mar 2023 08:36:33 +0100 Subject: 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 --- lang/cpp/src/key.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lang/cpp/src/key.cpp') 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() -- cgit v1.2.3