cpp: Add subkey keygrip to API

* lang/cpp/src/key.cpp (Subkey::keyGrip): New.
* lang/cpp/src/key.h: Update accordingly.
This commit is contained in:
Andre Heinecke 2017-03-02 09:35:05 +01:00
parent d63258066d
commit 8071a6b2ca
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C
3 changed files with 9 additions and 1 deletions

1
NEWS
View File

@ -19,6 +19,7 @@ Noteworthy changes in version 1.8.1 (unreleased)
cpp: Key::UserID::revoke() NEW. cpp: Key::UserID::revoke() NEW.
cpp: Key::addUid() NEW. cpp: Key::addUid() NEW.
cpp: GpgGenCardKeyInteractor NEW. cpp: GpgGenCardKeyInteractor NEW.
cpp: Subkey::keyGrip NEW.
qt: CryptoConfig::stringValueList() NEW. qt: CryptoConfig::stringValueList() NEW.
gpgme_data_rewind UN-DEPRECATE. gpgme_data_rewind UN-DEPRECATE.
py: Context.__init__ EXTENDED: New keyword arg home_dir. py: Context.__init__ EXTENDED: New keyword arg home_dir.

View File

@ -476,7 +476,12 @@ bool Subkey::isCardKey() const
const char *Subkey::cardSerialNumber() 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 bool Subkey::isSecret() const

View File

@ -270,6 +270,8 @@ public:
const char *cardSerialNumber() const; const char *cardSerialNumber() const;
const char *keyGrip() const;
private: private:
shared_gpgme_key_t key; shared_gpgme_key_t key;
gpgme_sub_key_t subkey; gpgme_sub_key_t subkey;