diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-12-27 18:32:54 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-12-27 18:32:54 +0000 |
commit | 03f660c0b01f9f2f032b3c63255e2768a39b5f24 (patch) | |
tree | 4b13274f85bfe8b1f822269a7a53a1282965097f | |
parent | show importdetaildialog in all places (diff) | |
download | gpg4usb-03f660c0b01f9f2f032b3c63255e2768a39b5f24.tar.gz gpg4usb-03f660c0b01f9f2f032b3c63255e2768a39b5f24.zip |
add methods getKexByFpr / byId to gpgcontext
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@705 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | gpgcontext.cpp | 27 | ||||
-rw-r--r-- | gpgcontext.h | 3 |
2 files changed, 30 insertions, 0 deletions
diff --git a/gpgcontext.cpp b/gpgcontext.cpp index a388199..55902d7 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -718,6 +718,33 @@ QString GpgContext::beautifyFingerprint(QString fingerprint) return fingerprint; } +/** + * note: privkey status is not returned + */ +GpgKey GpgContext::getKeyByFpr(QString fpr) { + + GpgKeyList list = this->listKeys(); + foreach (GpgKey key, list) { + if(key.fpr == fpr) { + return key; + } + } +} + + +/** + * note: privkey status is not returned + */ +GpgKey GpgContext::getKeyById(QString id) { + + GpgKeyList list = this->listKeys(); + foreach (GpgKey key, list) { + if(key.id == id) { + return key; + } + } +} + } diff --git a/gpgcontext.h b/gpgcontext.h index 92e0613..ed605cf 100644 --- a/gpgcontext.h +++ b/gpgcontext.h @@ -130,6 +130,9 @@ public: */ void preventNoDataErr(QByteArray *in); + GpgKey getKeyByFpr(QString fpr); + GpgKey getKeyById(QString id); + /** * @brief * |