diff options
author | Saturneric <[email protected]> | 2021-09-04 07:18:45 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-09-04 07:18:45 +0000 |
commit | 4d9024347b0780afb955f0dbbda5d38907fe5200 (patch) | |
tree | 268022cbb9be8d7ca21b8dc7ae5f7834bd3f03ac /include/gpg/model/GpgKey.h | |
parent | Modified VerifyResultAnalyse (diff) | |
download | GpgFrontend-4d9024347b0780afb955f0dbbda5d38907fe5200.tar.gz GpgFrontend-4d9024347b0780afb955f0dbbda5d38907fe5200.zip |
Modified ResultAnalyse.
Add Test.
Diffstat (limited to '')
-rw-r--r-- | include/gpg/model/GpgKey.h | 9 |
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; } |