aboutsummaryrefslogtreecommitdiffstats
path: root/include/gpg/GpgSubKey.h
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-05-22 15:58:59 +0000
committerSaturneric <[email protected]>2021-05-22 15:58:59 +0000
commitd9121e76c7eeb63b23a6a772d38e61b60abfe93d (patch)
tree965f9f27bba242a584b73ef4947ce54fa652390f /include/gpg/GpgSubKey.h
parentExpand and improve GpgKey; (diff)
downloadGpgFrontend-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 'include/gpg/GpgSubKey.h')
-rw-r--r--include/gpg/GpgSubKey.h29
1 files changed, 5 insertions, 24 deletions
diff --git a/include/gpg/GpgSubKey.h b/include/gpg/GpgSubKey.h
index f495c709..229e04c9 100644
--- a/include/gpg/GpgSubKey.h
+++ b/include/gpg/GpgSubKey.h
@@ -50,31 +50,12 @@ struct GpgSubKey {
QDateTime timestamp;
QDateTime expires;
- GpgSubKey() = default;
+ explicit GpgSubKey(gpgme_subkey_t key = nullptr);
- explicit GpgSubKey(gpgme_subkey_t key) {
-
- 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);
- }
+ GpgSubKey(GpgSubKey &&) noexcept = default;
+ GpgSubKey(const GpgSubKey &) = default;
+ GpgSubKey& operator=(GpgSubKey &&) noexcept = default;
+ GpgSubKey& operator=(const GpgSubKey &) = default;
};