From 306fd9c915cbccddbd146f37ba9bd826f10d2535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Thu, 5 May 2022 17:24:07 +0200 Subject: [PATCH] cpp: Output more properties of a subkey * lang/cpp/src/key.cpp (ostream operator<< for Subkey): Fix wrong output of isInvalid and isDisabled flags. Add output of key grip, card serial number and the flags isSecret, isQualified, isDeVs, and isCardKey. -- This makes it easier to check those properties for different keys, e.g. with the run-keylist test program. GnuPG-bug-id: 5965 --- lang/cpp/src/key.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lang/cpp/src/key.cpp b/lang/cpp/src/key.cpp index b893a7cd..293c9e5b 100644 --- a/lang/cpp/src/key.cpp +++ b/lang/cpp/src/key.cpp @@ -1250,16 +1250,22 @@ std::ostream &operator<<(std::ostream &os, const Subkey &subkey) os << "GpgME::Subkey("; if (!subkey.isNull()) { os << "\n fingerprint: " << protect(subkey.fingerprint()) + << "\n keyGrip: " << protect(subkey.keyGrip()) << "\n creationTime: " << subkey.creationTime() << "\n expirationTime:" << subkey.expirationTime() << "\n isRevoked: " << subkey.isRevoked() << "\n isExpired: " << subkey.isExpired() - << "\n isInvalid: " << subkey.isRevoked() - << "\n isDisabled: " << subkey.isInvalid() + << "\n isInvalid: " << subkey.isInvalid() + << "\n isDisabled: " << subkey.isDisabled() << "\n canSign: " << subkey.canSign() << "\n canEncrypt: " << subkey.canEncrypt() << "\n canCertify: " << subkey.canCertify() - << "\n canAuth: " << subkey.canAuthenticate(); + << "\n canAuth: " << subkey.canAuthenticate() + << "\n isSecret: " << subkey.isSecret() + << "\n isQualified: " << subkey.isQualified() + << "\n isDeVs: " << subkey.isDeVs() + << "\n isCardKey: " << subkey.isCardKey() + << "\n cardSerialNumber:" << protect(subkey.cardSerialNumber()); } return os << ')'; }