aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-27 18:32:54 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-27 18:32:54 +0000
commit03f660c0b01f9f2f032b3c63255e2768a39b5f24 (patch)
tree4b13274f85bfe8b1f822269a7a53a1282965097f
parentshow importdetaildialog in all places (diff)
downloadgpg4usb-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.cpp27
-rw-r--r--gpgcontext.h3
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
*