aboutsummaryrefslogtreecommitdiffstats
path: root/include/gpg/model/GpgKey.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/gpg/model/GpgKey.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/gpg/model/GpgKey.h b/include/gpg/model/GpgKey.h
index bc38c6c6..03029f69 100644
--- a/include/gpg/model/GpgKey.h
+++ b/include/gpg/model/GpgKey.h
@@ -85,6 +85,15 @@ namespace GpgFrontend {
[[nodiscard]] bool can_authenticate() const { return _key_ref->can_authenticate; }
+ bool canAuthActual() {
+ auto subkeys = subKeys();
+ if (std::any_of(subkeys->begin(), subkeys->end(), [](const GpgSubKey &subkey) -> bool {
+ return subkey.secret() && subkey.can_authenticate() && !subkey.disabled() && !subkey.revoked() && !subkey.expired();
+ }))
+ return true;
+ else return false;
+ }
+
[[nodiscard]] bool is_private_key() const { return _key_ref->secret; }