aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/model/GpgKey.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpg/model/GpgKey.h')
-rw-r--r--src/gpg/model/GpgKey.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gpg/model/GpgKey.h b/src/gpg/model/GpgKey.h
index fb7d5735..0ce83372 100644
--- a/src/gpg/model/GpgKey.h
+++ b/src/gpg/model/GpgKey.h
@@ -108,6 +108,13 @@ 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 { return subkey.is_cardkey(); });
+ }
+
[[nodiscard]] bool is_private_key() const { return _key_ref->secret; }
[[nodiscard]] bool expired() const { return _key_ref->expired; }