29 #ifndef GPG_CONSTANTS_H
30 #define GPG_CONSTANTS_H
32 #include "GpgFrontendCore.h"
34 const int RESTART_CODE = 1000;
38 using ByteArray = std::string;
39 using ByteArrayPtr = std::unique_ptr<ByteArray>;
40 using StdBypeArrayPtr = std::unique_ptr<ByteArray>;
41 using BypeArrayRef = ByteArray&;
42 using BypeArrayConstRef =
const ByteArray&;
43 using StringArgsPtr = std::unique_ptr<std::vector<std::string>>;
44 using StringArgsRef = std::vector<std::string>&;
46 using GpgError = gpgme_error_t;
53 void operator()(
void* _result);
56 using GpgEncrResult = std::shared_ptr<struct _gpgme_op_encrypt_result>;
57 using GpgDecrResult = std::shared_ptr<struct _gpgme_op_decrypt_result>;
58 using GpgSignResult = std::shared_ptr<struct _gpgme_op_sign_result>;
59 using GpgVerifyResult = std::shared_ptr<struct _gpgme_op_verify_result>;
60 using GpgGenKeyResult = std::shared_ptr<struct _gpgme_op_genkey_result>;
70 GPGFRONTEND_CORE_EXPORT GpgEncrResult
79 GPGFRONTEND_CORE_EXPORT GpgDecrResult
88 GPGFRONTEND_CORE_EXPORT GpgSignResult
_new_result(gpgme_sign_result_t&& result);
96 GPGFRONTEND_CORE_EXPORT GpgVerifyResult
105 GPGFRONTEND_CORE_EXPORT GpgGenKeyResult
126 const std::string& comment);
136 gpgme_error_t err, gpgme_error_t predict = GPG_ERR_NO_ERROR);
147 BypeArrayConstRef fingerprint);
168 const std::string& path,
const std::string& out_buffer);
197 const int GPGFRONTEND_DEFAULT_CHANNEL = 0;
198 const int GPGFRONTEND_NON_ASCII_CHANNEL = 2;
207 static const char* PGP_CRYPT_END;
208 static const char* PGP_SIGNED_BEGIN;
209 static const char* PGP_SIGNED_END;
210 static const char* PGP_SIGNATURE_BEGIN;
211 static const char* PGP_SIGNATURE_END;
212 static const char* PGP_PUBLIC_KEY_BEGIN;
213 static const char* PGP_PRIVATE_KEY_BEGIN;
214 static const char* GPG_FRONTEND_SHORT_CRYPTO_HEAD;
Definition: GpgConstants.h:204
static const char * PGP_CRYPT_BEGIN
Definition: GpgConstants.h:206
Definition: CoreCommonUtil.cpp:29
int text_is_signed(BypeArrayRef text)
Definition: GpgConstants.cpp:158
GPGFRONTEND_CORE_EXPORT GpgEncrResult _new_result(gpgme_encrypt_result_t &&result)
Definition: GpgConstants.cpp:173
GPGFRONTEND_CORE_EXPORT gpg_err_code_t check_gpg_error_2_err_code(gpgme_error_t err, gpgme_error_t predict=GPG_ERR_NO_ERROR)
Definition: GpgConstants.cpp:63
GPGFRONTEND_CORE_EXPORT bool write_buffer_to_file(const std::string &path, const std::string &out_buffer)
Definition: GpgConstants.cpp:128
std::string get_only_file_name_with_path(const std::string &path)
Get the only file name with path object.
Definition: GpgConstants.cpp:146
std::string read_all_data_in_file(const std::string &path)
Definition: GpgConstants.cpp:122
GPGFRONTEND_CORE_EXPORT std::string beautify_fingerprint(BypeArrayConstRef fingerprint)
Definition: GpgConstants.cpp:90
std::string get_file_extension(const std::string &path)
Get the file extension object.
Definition: GpgConstants.cpp:133
GPGFRONTEND_CORE_EXPORT GpgError check_gpg_error(GpgError err)
Definition: GpgConstants.cpp:54
Result Deleter.
Definition: GpgConstants.h:52