diff options
author | saturneric <[email protected]> | 2024-01-10 03:41:34 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-10 03:41:34 +0000 |
commit | 802d7ed9907a08941af353fd65c6d528a8d5ba2c (patch) | |
tree | 4362de48824e960053fbb57fc29f078797af68e3 /src/core/function/gpg/GpgKeyImportExporter.h | |
parent | fix: slove some of the app building issues (diff) | |
download | GpgFrontend-802d7ed9907a08941af353fd65c6d528a8d5ba2c.tar.gz GpgFrontend-802d7ed9907a08941af353fd65c6d528a8d5ba2c.zip |
feat: update core apis, functions and models
Diffstat (limited to 'src/core/function/gpg/GpgKeyImportExporter.h')
-rw-r--r-- | src/core/function/gpg/GpgKeyImportExporter.h | 61 |
1 files changed, 9 insertions, 52 deletions
diff --git a/src/core/function/gpg/GpgKeyImportExporter.h b/src/core/function/gpg/GpgKeyImportExporter.h index 3c88c2c5..707bd895 100644 --- a/src/core/function/gpg/GpgKeyImportExporter.h +++ b/src/core/function/gpg/GpgKeyImportExporter.h @@ -30,6 +30,7 @@ #include "core/function/basic/GpgFunctionObject.h" #include "core/function/gpg/GpgContext.h" +#include "core/model/GFBuffer.h" #include "core/typedef/CoreTypedef.h" #include "core/typedef/GpgTypedef.h" @@ -105,26 +106,14 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyImportExporter /** * @brief * - * @param uid_list - * @param out_buffer - * @param secret - * @return true - * @return false - */ - auto ExportKeys(KeyIdArgsListPtr& uid_list, ByteArrayPtr& out_buffer, - bool secret = false) const -> bool; - - /** - * @brief - * - * @param keys - * @param outBuffer + * @param key * @param secret - * @return true - * @return false + * @param ascii + * @return std::tuple<GpgError, GFBuffer> */ - auto ExportKeys(const KeyArgsList& keys, ByteArrayPtr& outBuffer, - bool secret = false) const -> bool; + [[nodiscard]] auto ExportKey(const GpgKey& key, bool secret, bool ascii, + bool shortest) const + -> std::tuple<GpgError, GFBuffer>; /** * @brief @@ -135,18 +124,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyImportExporter * @return true * @return false */ - auto ExportAllKeys(KeyIdArgsListPtr& uid_list, ByteArrayPtr& out_buffer, - bool secret) const -> bool; - - /** - * @brief - * - * @param key - * @param out_buffer - * @return true - * @return false - */ - auto ExportKey(const GpgKey& key, ByteArrayPtr& out_buffer) const -> bool; + void ExportKeys(const KeyArgsList& keys, bool secret, bool ascii, + const GpgOperationCallback& cb) const; /** * @brief @@ -159,28 +138,6 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyImportExporter auto ExportKeyOpenSSH(const GpgKey& key, ByteArrayPtr& out_buffer) const -> bool; - /** - * @brief - * - * @param key - * @param outBuffer - * @return true - * @return false - */ - auto ExportSecretKey(const GpgKey& key, ByteArrayPtr& outBuffer) const - -> bool; - - /** - * @brief - * - * @param key - * @param outBuffer - * @return true - * @return false - */ - auto ExportSecretKeyShortest(const GpgKey& key, ByteArrayPtr& outBuffer) const - -> bool; - private: GpgContext& ctx_; }; |