cpp: Add subkey keygrip to API
authorAndre Heinecke <aheinecke@intevation.de>
Thu, 2 Mar 2017 08:35:05 +0000 (09:35 +0100)
committerAndre Heinecke <aheinecke@intevation.de>
Thu, 2 Mar 2017 08:38:31 +0000 (09:38 +0100)
* lang/cpp/src/key.cpp (Subkey::keyGrip): New.
* lang/cpp/src/key.h: Update accordingly.

NEWS
lang/cpp/src/key.cpp
lang/cpp/src/key.h

diff --git a/NEWS b/NEWS
index 4ad1cea..7899522 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ Noteworthy changes in version 1.8.1 (unreleased)
  cpp: Key::UserID::revoke()                         NEW.
  cpp: Key::addUid()                                 NEW.
  cpp: GpgGenCardKeyInteractor                       NEW.
+ cpp: Subkey::keyGrip                               NEW.
  qt: CryptoConfig::stringValueList()                NEW.
  gpgme_data_rewind                                  UN-DEPRECATE.
  py: Context.__init__        EXTENDED: New keyword arg home_dir.
index 3cc26a7..9eebbf0 100644 (file)
@@ -476,7 +476,12 @@ bool Subkey::isCardKey() const
 
 const char *Subkey::cardSerialNumber() const
 {
-    return subkey ? subkey->card_number : 0 ;
+    return subkey ? subkey->card_number : nullptr;
+}
+
+const char *Subkey::keyGrip() const
+{
+    return subkey ? subkey->keygrip : nullptr;
 }
 
 bool Subkey::isSecret() const
index b0599c7..8c11a9d 100644 (file)
@@ -270,6 +270,8 @@ public:
 
     const char *cardSerialNumber() const;
 
+    const char *keyGrip() const;
+
 private:
     shared_gpgme_key_t key;
     gpgme_sub_key_t subkey;