diff options
author | Saturneric <[email protected]> | 2022-05-12 17:11:32 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-05-12 17:11:32 +0000 |
commit | 865ce3654497c45cba8e0f7f6bd2d613f8798c97 (patch) | |
tree | cdfc5499b6246f04ca0956dbfdd54206335ab9cc /src/core/function/gpg/GpgKeyGetter.h | |
parent | fix(ui): adjuest timeout value for keyserver test (diff) | |
download | GpgFrontend-dev/2.0.7.tar.gz GpgFrontend-dev/2.0.7.zip |
fix(core): fix a bug when key in smart carddev/2.0.7
Diffstat (limited to 'src/core/function/gpg/GpgKeyGetter.h')
-rw-r--r-- | src/core/function/gpg/GpgKeyGetter.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/core/function/gpg/GpgKeyGetter.h b/src/core/function/gpg/GpgKeyGetter.h index 72cd777c..c96dbea7 100644 --- a/src/core/function/gpg/GpgKeyGetter.h +++ b/src/core/function/gpg/GpgKeyGetter.h @@ -59,7 +59,7 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyGetter * @param fpr * @return GpgKey */ - GpgKey GetKey(const std::string& id); + GpgKey GetKey(const std::string& id, bool use_cache = true); /** * @brief Get the Keys object @@ -75,7 +75,7 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyGetter * @param fpr * @return GpgKey */ - GpgKey GetPubkey(const std::string& id); + GpgKey GetPubkey(const std::string& id, bool use_cache = true); /** * @brief Get all the keys by receiving a linked list @@ -108,7 +108,7 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyGetter private: /** - * @brief + * @brief Get the gpgme context object * */ GpgContext& ctx_ = @@ -121,7 +121,7 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyGetter mutable std::mutex ctx_mutex_; /** - * @brief cache the keys with key fpr + * @brief cache the keys with key id * */ std::map<std::string, GpgKey> keys_cache_; @@ -131,6 +131,14 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyGetter * */ mutable std::mutex keys_cache_mutex_; + + /** + * @brief Get the Key object + * + * @param id + * @return GpgKey + */ + GpgKey get_key_in_cache(const std::string& id); }; } // namespace GpgFrontend |