aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/function/GpgFileOpera.h
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-01-14 11:35:01 +0000
committerSaturneric <[email protected]>2022-01-14 11:35:01 +0000
commit990aefc086795d74170b22055c5051595ce5b0fc (patch)
tree65354401a49d0b8cf2eb82fb17d580abff6476cc /src/gpg/function/GpgFileOpera.h
parent<feat>(project): Generate compile commands.json by default (diff)
downloadGpgFrontend-990aefc086795d74170b22055c5051595ce5b0fc.tar.gz
GpgFrontend-990aefc086795d74170b22055c5051595ce5b0fc.zip
<doc>(core): add comment for code
Diffstat (limited to 'src/gpg/function/GpgFileOpera.h')
-rw-r--r--src/gpg/function/GpgFileOpera.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/gpg/function/GpgFileOpera.h b/src/gpg/function/GpgFileOpera.h
index f4508f42..e08c9ba6 100644
--- a/src/gpg/function/GpgFileOpera.h
+++ b/src/gpg/function/GpgFileOpera.h
@@ -31,34 +31,97 @@
namespace GpgFrontend {
+/**
+ * @brief Executive files related to the basic operations that are provided by
+ * BasicOperator
+ * @class class: BasicOperator
+ */
class GpgFileOpera : public SingletonFunctionObject<GpgFileOpera> {
public:
explicit GpgFileOpera(
int channel = SingletonFunctionObject::GetDefaultChannel())
: SingletonFunctionObject<GpgFileOpera>(channel) {}
+ /**
+ * @brief Encrypted file
+ *
+ * @param keys Used public key
+ * @param in_path The path where the enter file is located
+ * @param out_path The path where the output file is located
+ * @param result Encrypted results
+ * @param _channel Channel in context
+ * @return unsigned int error code
+ */
static unsigned int EncryptFile(KeyListPtr keys, const std::string& in_path,
const std::string& out_path,
GpgEncrResult& result,
int _channel = GPGFRONTEND_DEFAULT_CHANNEL);
+ /**
+ * @brief 运用对称加密算法加密文件
+ *
+ * @param in_path
+ * @param out_path
+ * @param result
+ * @param _channel
+ * @return unsigned int
+ */
static unsigned int EncryptFileSymmetric(
const std::string& in_path, const std::string& out_path,
GpgEncrResult& result, int _channel = GPGFRONTEND_DEFAULT_CHANNEL);
+ /**
+ * @brief
+ *
+ * @param in_path
+ * @param out_path
+ * @param result
+ * @return GpgError
+ */
static GpgError DecryptFile(const std::string& in_path,
const std::string& out_path,
GpgDecrResult& result);
+ /**
+ * @brief
+ *
+ * @param keys
+ * @param in_path
+ * @param out_path
+ * @param result
+ * @param _channel
+ * @return GpgError
+ */
static GpgError SignFile(KeyListPtr keys, const std::string& in_path,
const std::string& out_path, GpgSignResult& result,
int _channel = GPGFRONTEND_DEFAULT_CHANNEL);
+ /**
+ * @brief
+ *
+ * @param data_path
+ * @param sign_path
+ * @param result
+ * @param _channel
+ * @return GpgError
+ */
static GpgError VerifyFile(const std::string& data_path,
const std::string& sign_path,
GpgVerifyResult& result,
int _channel = GPGFRONTEND_DEFAULT_CHANNEL);
+ /**
+ * @brief
+ *
+ * @param keys
+ * @param signer_keys
+ * @param in_path
+ * @param out_path
+ * @param encr_res
+ * @param sign_res
+ * @param _channel
+ * @return GpgError
+ */
static GpgError EncryptSignFile(KeyListPtr keys, KeyListPtr signer_keys,
const std::string& in_path,
const std::string& out_path,
@@ -66,6 +129,15 @@ class GpgFileOpera : public SingletonFunctionObject<GpgFileOpera> {
GpgSignResult& sign_res,
int _channel = GPGFRONTEND_DEFAULT_CHANNEL);
+ /**
+ * @brief
+ *
+ * @param in_path
+ * @param out_path
+ * @param decr_res
+ * @param verify_res
+ * @return GpgError
+ */
static GpgError DecryptVerifyFile(const std::string& in_path,
const std::string& out_path,
GpgDecrResult& decr_res,