aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/model/GpgKey.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/gpg/model/GpgKey.h8
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; }