29 #ifndef GPG_CONSTANTS_H
30 #define GPG_CONSTANTS_H
32 #include <GpgFrontend.h>
39 #include "GpgFrontendCoreExport.h"
41 const int RESTART_CODE = 1000;
45 using ByteArray = std::string;
46 using ByteArrayPtr = std::unique_ptr<ByteArray>;
47 using StdBypeArrayPtr = std::unique_ptr<ByteArray>;
48 using BypeArrayRef = ByteArray&;
49 using BypeArrayConstRef =
const ByteArray&;
50 using StringArgsPtr = std::unique_ptr<std::vector<std::string>>;
51 using StringArgsRef = std::vector<std::string>&;
53 using GpgError = gpgme_error_t;
60 void operator()(
void* _result);
63 using GpgEncrResult = std::shared_ptr<struct _gpgme_op_encrypt_result>;
64 using GpgDecrResult = std::shared_ptr<struct _gpgme_op_decrypt_result>;
65 using GpgSignResult = std::shared_ptr<struct _gpgme_op_sign_result>;
66 using GpgVerifyResult = std::shared_ptr<struct _gpgme_op_verify_result>;
67 using GpgGenKeyResult = std::shared_ptr<struct _gpgme_op_genkey_result>;
77 GPGFRONTEND_CORE_EXPORT GpgEncrResult
86 GPGFRONTEND_CORE_EXPORT GpgDecrResult
95 GPGFRONTEND_CORE_EXPORT GpgSignResult
_new_result(gpgme_sign_result_t&& result);
103 GPGFRONTEND_CORE_EXPORT GpgVerifyResult
112 GPGFRONTEND_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);
204 const int GPGFRONTEND_DEFAULT_CHANNEL = 0;
205 const 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;
226 #endif // GPG_CONSTANTS_H