diff options
author | Saturneric <[email protected]> | 2022-01-14 19:48:15 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-01-14 19:48:15 +0000 |
commit | df550288147b32dc42dd9161e2a4da52e1f794ea (patch) | |
tree | a370b0964c5ce30d42759f39e5200deec5c821d6 /src/gpg/function/GpgKeyManager.h | |
parent | <doc>(core): add comment for code (diff) | |
download | GpgFrontend-df550288147b32dc42dd9161e2a4da52e1f794ea.tar.gz GpgFrontend-df550288147b32dc42dd9161e2a4da52e1f794ea.zip |
<doc, refactor>(ci): Tidy up code in gpg/function
1. Rename related entities.
2. Add a comments.
Diffstat (limited to 'src/gpg/function/GpgKeyManager.h')
-rw-r--r-- | src/gpg/function/GpgKeyManager.h | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/src/gpg/function/GpgKeyManager.h b/src/gpg/function/GpgKeyManager.h index b2444e8d..ee8b4f6c 100644 --- a/src/gpg/function/GpgKeyManager.h +++ b/src/gpg/function/GpgKeyManager.h @@ -31,31 +31,57 @@ namespace GpgFrontend { +/** + * @brief + * + */ class GpgKeyManager : public SingletonFunctionObject<GpgKeyManager> { public: + /** + * @brief Construct a new Gpg Key Manager object + * + * @param channel + */ explicit GpgKeyManager( int channel = SingletonFunctionObject::GetDefaultChannel()) : SingletonFunctionObject<GpgKeyManager>(channel) {} /** - * Sign a key pair(actually a certain uid) + * @brief Sign a key pair(actually a certain uid) * @param target target key pair * @param uid target * @param expires expire date and time of the signature * @return if successful */ - bool signKey(const GpgKey& target, KeyArgsList& keys, const std::string& uid, + bool SignKey(const GpgKey& target, KeyArgsList& keys, const std::string& uid, const std::unique_ptr<boost::posix_time::ptime>& expires); - bool revSign(const GpgFrontend::GpgKey& key, + /** + * @brief + * + * @param key + * @param signature_id + * @return true + * @return false + */ + bool RevSign(const GpgFrontend::GpgKey& key, const GpgFrontend::SignIdArgsListPtr& signature_id); - bool setExpire(const GpgKey& key, std::unique_ptr<GpgSubKey>& subkey, + /** + * @brief Set the Expire object + * + * @param key + * @param subkey + * @param expires + * @return true + * @return false + */ + bool SetExpire(const GpgKey& key, std::unique_ptr<GpgSubKey>& subkey, std::unique_ptr<boost::posix_time::ptime>& expires); private: - GpgContext& ctx = - GpgContext::GetInstance(SingletonFunctionObject::GetChannel()); + GpgContext& ctx_ = + GpgContext::GetInstance(SingletonFunctionObject::GetChannel()); ///< }; } // namespace GpgFrontend |