diff options
author | Saturneric <[email protected]> | 2022-01-03 18:33:35 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-01-03 18:33:35 +0000 |
commit | 9a4fa7019dde788dd337f406dc2d52e4c94b696c (patch) | |
tree | c8582139ce865c6f1ab35291d6e36618e09e1131 /src/gpg/model/GpgKey.h | |
parent | <feature>(ui): default sender gpg key settings in send mail. (diff) | |
download | GpgFrontend-9a4fa7019dde788dd337f406dc2d52e4c94b696c.tar.gz GpgFrontend-9a4fa7019dde788dd337f406dc2d52e4c94b696c.zip |
<fix, feature>(core, ui): add key in smart card support.
1.fix problem that when key is in a smart card, the result of FetchKey() is not equal with which provided by GetKey().
Diffstat (limited to '')
-rw-r--r-- | src/gpg/model/GpgKey.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpg/model/GpgKey.h b/src/gpg/model/GpgKey.h index fb7d5735..3336f39e 100644 --- a/src/gpg/model/GpgKey.h +++ b/src/gpg/model/GpgKey.h @@ -108,6 +108,14 @@ class GpgKey { [[nodiscard]] bool CanAuthActual() const; + [[nodiscard]] bool HasCardKey() const { + auto subkeys = subKeys(); + return std::any_of(subkeys->begin(), subkeys->end(), + [](const GpgSubKey& subkey) -> bool { + if (subkey.is_cardkey()) return true; + }); + } + [[nodiscard]] bool is_private_key() const { return _key_ref->secret; } [[nodiscard]] bool expired() const { return _key_ref->expired; } |