aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
*