aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg/GpgFileOpera.h
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-12-25 12:51:01 +0000
committersaturneric <[email protected]>2023-12-25 12:51:01 +0000
commit5260d7a5634279408b3eb36a5f26fe71fb6f9e69 (patch)
tree670e0878a41e8c6b1651fedbd224bfbea94e0849 /src/core/function/gpg/GpgFileOpera.h
parentfix: use the new async encrypt symmetric api at gui app (diff)
downloadGpgFrontend-5260d7a5634279408b3eb36a5f26fe71fb6f9e69.tar.gz
GpgFrontend-5260d7a5634279408b3eb36a5f26fe71fb6f9e69.zip
feat: upgrade basical operations fully to async style and update test cases
Diffstat (limited to 'src/core/function/gpg/GpgFileOpera.h')
-rw-r--r--src/core/function/gpg/GpgFileOpera.h27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/core/function/gpg/GpgFileOpera.h b/src/core/function/gpg/GpgFileOpera.h
index ec34487c..0f0d65bf 100644
--- a/src/core/function/gpg/GpgFileOpera.h
+++ b/src/core/function/gpg/GpgFileOpera.h
@@ -50,7 +50,7 @@ class GPGFRONTEND_CORE_EXPORT GpgFileOpera {
* @param channel Channel in context
* @return unsigned int error code
*/
- static void EncryptFile(std::vector<GpgKey> keys, const std::string& in_path,
+ static void EncryptFile(KeyArgsList keys, const std::string& in_path,
const std::string& out_path, bool ascii,
const GpgOperationCallback& cb);
@@ -89,9 +89,9 @@ class GPGFRONTEND_CORE_EXPORT GpgFileOpera {
* @param channel
* @return GpgError
*/
- static auto SignFile(KeyListPtr keys, const std::string& in_path,
- const std::string& out_path, GpgSignResult& result,
- int channel = kGpgFrontendDefaultChannel) -> GpgError;
+ static void SignFile(KeyArgsList keys, const std::string& in_path,
+ const std::string& out_path, bool ascii,
+ const GpgOperationCallback& cb);
/**
* @brief Verify file with public key
@@ -102,9 +102,9 @@ class GPGFRONTEND_CORE_EXPORT GpgFileOpera {
* @param channel Channel in context
* @return GpgError
*/
- static auto VerifyFile(const std::string& data_path,
- const std::string& sign_path, GpgVerifyResult& result,
- int channel = kGpgFrontendDefaultChannel) -> GpgError;
+ static void VerifyFile(const std::string& data_path,
+ const std::string& sign_path,
+ const GpgOperationCallback& cb);
/**
* @brief Encrypt and sign file with public key and private key
@@ -118,12 +118,10 @@ class GPGFRONTEND_CORE_EXPORT GpgFileOpera {
* @param channel
* @return GpgError
*/
- static auto EncryptSignFile(KeyListPtr keys, KeyListPtr signer_keys,
+ static void EncryptSignFile(KeyArgsList keys, KeyArgsList signer_keys,
const std::string& in_path,
- const std::string& out_path,
- GpgEncrResult& encr_res, GpgSignResult& sign_res,
- int channel = kGpgFrontendDefaultChannel)
- -> GpgError;
+ const std::string& out_path, bool ascii,
+ const GpgOperationCallback& cb);
/**
* @brief
@@ -134,10 +132,9 @@ class GPGFRONTEND_CORE_EXPORT GpgFileOpera {
* @param verify_res
* @return GpgError
*/
- static auto DecryptVerifyFile(const std::string& in_path,
+ static void DecryptVerifyFile(const std::string& in_path,
const std::string& out_path,
- GpgDecrResult& decr_res,
- GpgVerifyResult& verify_res) -> GpgError;
+ const GpgOperationCallback& cb);
};
} // namespace GpgFrontend