aboutsummaryrefslogtreecommitdiffstats
path: root/include/gpg/model/GpgKey.h
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-09-04 07:18:45 +0000
committerSaturneric <[email protected]>2021-09-04 07:18:45 +0000
commit4d9024347b0780afb955f0dbbda5d38907fe5200 (patch)
tree268022cbb9be8d7ca21b8dc7ae5f7834bd3f03ac /include/gpg/model/GpgKey.h
parentModified VerifyResultAnalyse (diff)
downloadGpgFrontend-4d9024347b0780afb955f0dbbda5d38907fe5200.tar.gz
GpgFrontend-4d9024347b0780afb955f0dbbda5d38907fe5200.zip
Modified ResultAnalyse.
Add Test.
Diffstat (limited to 'include/gpg/model/GpgKey.h')
-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; }