29#ifndef GPG_CONSTANTS_H
30#define GPG_CONSTANTS_H
32#include <GpgFrontend.h>
39#include "GpgFrontendCoreExport.h"
41const int RESTART_CODE = 1000;
45using ByteArray = std::string;
46using ByteArrayPtr = std::unique_ptr<ByteArray>;
47using StdBypeArrayPtr = std::unique_ptr<ByteArray>;
48using BypeArrayRef = ByteArray&;
49using BypeArrayConstRef =
const ByteArray&;
50using StringArgsPtr = std::unique_ptr<std::vector<std::string>>;
51using StringArgsRef = std::vector<std::string>&;
53using GpgError = gpgme_error_t;
60 void operator()(
void* _result);
63using GpgEncrResult = std::shared_ptr<struct _gpgme_op_encrypt_result>;
64using GpgDecrResult = std::shared_ptr<struct _gpgme_op_decrypt_result>;
65using GpgSignResult = std::shared_ptr<struct _gpgme_op_sign_result>;
66using GpgVerifyResult = std::shared_ptr<struct _gpgme_op_verify_result>;
67using GpgGenKeyResult = std::shared_ptr<struct _gpgme_op_genkey_result>;
77GPGFRONTEND_CORE_EXPORT GpgEncrResult
86GPGFRONTEND_CORE_EXPORT GpgDecrResult
95GPGFRONTEND_CORE_EXPORT GpgSignResult
_new_result(gpgme_sign_result_t&& result);
103GPGFRONTEND_CORE_EXPORT GpgVerifyResult
112GPGFRONTEND_CORE_EXPORT GpgGenKeyResult
133 const std::string& comment);
143 gpgme_error_t err, gpgme_error_t predict = GPG_ERR_NO_ERROR);
154 BypeArrayConstRef fingerprint);
175 const std::string& path,
const std::string& out_buffer);
204const int GPGFRONTEND_DEFAULT_CHANNEL = 0;
205const int GPGFRONTEND_NON_ASCII_CHANNEL = 2;
214 static const char* PGP_CRYPT_END;
215 static const char* PGP_SIGNED_BEGIN;
216 static const char* PGP_SIGNED_END;
217 static const char* PGP_SIGNATURE_BEGIN;
218 static const char* PGP_SIGNATURE_END;
219 static const char* PGP_PUBLIC_KEY_BEGIN;
220 static const char* PGP_PRIVATE_KEY_BEGIN;
221 static const char* GPG_FRONTEND_SHORT_CRYPTO_HEAD;
Definition: GpgConstants.h:211
static const char * PGP_CRYPT_BEGIN
Definition: GpgConstants.h:213
Definition: CoreCommonUtil.cpp:29
int text_is_signed(BypeArrayRef text)
Definition: GpgConstants.cpp:176
GPGFRONTEND_CORE_EXPORT GpgEncrResult _new_result(gpgme_encrypt_result_t &&result)
Definition: GpgConstants.cpp:191
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:64
GPGFRONTEND_CORE_EXPORT bool write_buffer_to_file(const std::string &path, const std::string &out_buffer)
Definition: GpgConstants.cpp:135
std::string get_only_file_name_with_path(const std::string &path)
Get the only file name with path object.
Definition: GpgConstants.cpp:164
std::string read_all_data_in_file(const std::string &path)
Definition: GpgConstants.cpp:117
GPGFRONTEND_CORE_EXPORT std::string beautify_fingerprint(BypeArrayConstRef fingerprint)
Definition: GpgConstants.cpp:85
std::string get_file_extension(const std::string &path)
Get the file extension object.
Definition: GpgConstants.cpp:151
GPGFRONTEND_CORE_EXPORT GpgError check_gpg_error(GpgError err)
Definition: GpgConstants.cpp:55
Result Deleter.
Definition: GpgConstants.h:59