aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/GpgSubKey.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpg/GpgSubKey.cpp')
-rw-r--r--src/gpg/GpgSubKey.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gpg/GpgSubKey.cpp b/src/gpg/GpgSubKey.cpp
index e63c3139..0f8e279f 100644
--- a/src/gpg/GpgSubKey.cpp
+++ b/src/gpg/GpgSubKey.cpp
@@ -22,3 +22,29 @@
*
*/
#include "gpg/GpgSubKey.h"
+
+GpgSubKey::GpgSubKey(gpgme_subkey_t key) {
+
+ if (key == nullptr) return;
+
+ id = key->keyid;
+ pubkey_algo = gpgme_pubkey_algo_name(key->pubkey_algo);
+ fpr = key->fpr;
+
+ expired = (key->expired != 0u);
+ revoked = (key->revoked != 0u);
+
+ disabled = key->disabled;
+
+ length = key->length;
+
+ can_authenticate = key->can_authenticate;
+ can_certify = key->can_certify;
+ can_encrypt = key->can_encrypt;
+ can_sign = key->can_sign;
+ is_cardkey = key->is_cardkey;
+ is_private_key = key->secret;
+
+ timestamp = QDateTime::fromTime_t(key->timestamp);
+ expires = QDateTime::fromTime_t(key->expires);
+}