diff options
author | Saturneric <[email protected]> | 2021-10-02 14:08:50 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-10-02 14:16:27 +0000 |
commit | 3c65d087eeee687ac01af2e80f3dd538f9a2c230 (patch) | |
tree | 1e860dc6343c1897e2224a002f2ca44c574381b3 /src/gpg/function/UidOperator.h | |
parent | The basic functions of the core pass the test. (diff) | |
download | GpgFrontend-3c65d087eeee687ac01af2e80f3dd538f9a2c230.tar.gz GpgFrontend-3c65d087eeee687ac01af2e80f3dd538f9a2c230.zip |
UI Framework Modified.
Diffstat (limited to 'src/gpg/function/UidOperator.h')
-rw-r--r-- | src/gpg/function/UidOperator.h | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/src/gpg/function/UidOperator.h b/src/gpg/function/UidOperator.h index d5bbcb3b..e3068b1f 100644 --- a/src/gpg/function/UidOperator.h +++ b/src/gpg/function/UidOperator.h @@ -30,15 +30,28 @@ namespace GpgFrontend { -class UidOperator { -public: +class UidOperator : public SingletonFunctionObject<UidOperator> { + public: /** * create a new uid in certain key pair * @param key target key pair - * @param uid uid args + * @param uid uid args(combine name&comment&email) * @return if successful */ - bool addUID(const GpgKey &key, const GpgUID &uid); + bool addUID(const GpgKey& key, const std::string& uid); + + /** + * create a new uid in certain key pair + * @param key target key pair + * @param name + * @param comment + * @param email + * @return + */ + bool addUID(const GpgKey& key, + const std::string& name, + const std::string& comment, + const std::string& email); /** * Revoke(Delete) UID from certain key pair @@ -46,7 +59,7 @@ public: * @param uid target uid * @return if successful */ - bool revUID(const GpgKey &key, const GpgUID &uid); + bool revUID(const GpgKey& key, const std::string& uid); /** * Set one of a uid of a key pair as primary @@ -54,12 +67,12 @@ public: * @param uid target uid * @return if successful */ - bool setPrimaryUID(const GpgKey &key, const GpgUID &uid); + bool setPrimaryUID(const GpgKey& key, const std::string& uid); -private: - GpgContext &ctx = GpgContext::GetInstance(); + private: + GpgContext& ctx = GpgContext::GetInstance(); }; -} // namespace GpgFrontend +} // namespace GpgFrontend -#endif // GPGFRONTEND_ZH_CN_TS_UIDOPERATOR_H +#endif // GPGFRONTEND_ZH_CN_TS_UIDOPERATOR_H |