diff options
author | Saturneric <[email protected]> | 2021-05-22 15:58:59 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-05-22 15:58:59 +0000 |
commit | d9121e76c7eeb63b23a6a772d38e61b60abfe93d (patch) | |
tree | 965f9f27bba242a584b73ef4947ce54fa652390f /src/gpg/GpgSubKey.cpp | |
parent | Expand and improve GpgKey; (diff) | |
download | GpgFrontend-d9121e76c7eeb63b23a6a772d38e61b60abfe93d.tar.gz GpgFrontend-d9121e76c7eeb63b23a6a772d38e61b60abfe93d.zip |
Enhance code robustness;
Improve performance for GpgKey;
Fix code defects. Makes the update response to changes in the key database directed.
Signed-off-by: Saturneric <[email protected]>
Diffstat (limited to '')
-rw-r--r-- | src/gpg/GpgSubKey.cpp | 26 |
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); +} |