diff options
author | Saturneric <[email protected]> | 2021-09-20 09:35:57 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-09-20 09:35:57 +0000 |
commit | 8544bb3ed9ccf09f3082c3032381a1b61dc5e122 (patch) | |
tree | e5b12fd9c1331718dd60926ed7b4056361a8b68f /src/gpg/function/GpgFileOpera.cpp | |
parent | Support multi-channel Context. (diff) | |
download | GpgFrontend-8544bb3ed9ccf09f3082c3032381a1b61dc5e122.tar.gz GpgFrontend-8544bb3ed9ccf09f3082c3032381a1b61dc5e122.zip |
The basic functions of the core pass the test.
Adjust and improve the core part of the interface.
Diffstat (limited to 'src/gpg/function/GpgFileOpera.cpp')
-rw-r--r-- | src/gpg/function/GpgFileOpera.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gpg/function/GpgFileOpera.cpp b/src/gpg/function/GpgFileOpera.cpp index 79214d2d..0f78c30c 100644 --- a/src/gpg/function/GpgFileOpera.cpp +++ b/src/gpg/function/GpgFileOpera.cpp @@ -32,14 +32,14 @@ #include <string> GpgFrontend::GpgError GpgFrontend::GpgFileOpera::EncryptFile( - KeyArgsList& keys, + KeyArgsList&& keys, const std::string& path, GpgEncrResult& result) { std::string in_buffer = read_all_data_in_file(path); std::unique_ptr<std::string> out_buffer; - auto err = - BasicOperator::GetInstance().Encrypt(keys, in_buffer, out_buffer, result); + auto err = BasicOperator::GetInstance().Encrypt(std::move(keys), in_buffer, + out_buffer, result); assert(check_gpg_error_2_err_code(err) == GPG_ERR_NO_ERROR); @@ -69,14 +69,14 @@ GpgFrontend::GpgError GpgFrontend::GpgFileOpera::DecryptFile( return err; } -gpgme_error_t GpgFrontend::GpgFileOpera::SignFile(KeyArgsList& keys, +gpgme_error_t GpgFrontend::GpgFileOpera::SignFile(KeyArgsList&& keys, const std::string& path, GpgSignResult& result) { auto in_buffer = read_all_data_in_file(path); std::unique_ptr<std::string> out_buffer; - auto err = BasicOperator::GetInstance().Sign(keys, in_buffer, out_buffer, - GPGME_SIG_MODE_DETACH, result); + auto err = BasicOperator::GetInstance().Sign( + std::move(keys), in_buffer, out_buffer, GPGME_SIG_MODE_DETACH, result); assert(check_gpg_error_2_err_code(err) == GPG_ERR_NO_ERROR); @@ -108,7 +108,7 @@ gpgme_error_t GpgFrontend::GpgFileOpera::VerifyFile(const std::string& path, // TODO gpg_error_t GpgFrontend::GpgFileOpera::EncryptSignFile( - KeyArgsList& keys, + KeyArgsList&& keys, const std::string& path, GpgEncrResult& encr_res, GpgSignResult& sign_res) { @@ -120,7 +120,8 @@ gpg_error_t GpgFrontend::GpgFileOpera::EncryptSignFile( // TODO dealing with signer keys auto err = BasicOperator::GetInstance().EncryptSign( - keys, signerKeys, in_buffer, out_buffer, encr_res, sign_res); + std::move(keys), std::move(signerKeys), in_buffer, out_buffer, encr_res, + sign_res); assert(check_gpg_error_2_err_code(err) == GPG_ERR_NO_ERROR); |