GpgBasicOperator.h
#ifndef GPGFRONTEND_ZH_CN_TS_BASICOPERATOR_H
#define GPGFRONTEND_ZH_CN_TS_BASICOPERATOR_H
#include "core/GpgConstants.h"
#include "core/GpgContext.h"
#include "core/GpgFunctionObject.h"
#include "core/GpgModel.h"
namespace GpgFrontend {
class GPGFRONTEND_CORE_EXPORT GpgBasicOperator
: public SingletonFunctionObject<GpgBasicOperator> {
public:
explicit GpgBasicOperator(
int channel = SingletonFunctionObject::GetDefaultChannel());
gpg_error_t Encrypt(KeyListPtr keys, BypeArrayRef in_buffer,
ByteArrayPtr& out_buffer, GpgEncrResult& result);
gpg_error_t EncryptSymmetric(BypeArrayRef in_buffer, ByteArrayPtr& out_buffer,
GpgEncrResult& result);
gpgme_error_t EncryptSign(KeyListPtr keys, KeyListPtr signers,
BypeArrayRef in_buffer, ByteArrayPtr& out_buffer,
GpgEncrResult& encr_result,
GpgSignResult& sign_result);
gpgme_error_t Decrypt(BypeArrayRef in_buffer, ByteArrayPtr& out_buffer,
GpgDecrResult& result);
gpgme_error_t DecryptVerify(BypeArrayRef in_buffer, ByteArrayPtr& out_buffer,
GpgDecrResult& decrypt_result,
GpgVerifyResult& verify_result);
gpgme_error_t Verify(BypeArrayRef in_buffer, ByteArrayPtr& sig_buffer,
GpgVerifyResult& result) const;
gpg_error_t Sign(KeyListPtr signers, BypeArrayRef in_buffer,
ByteArrayPtr& out_buffer, gpgme_sig_mode_t mode,
GpgSignResult& result);
void SetSigners(KeyArgsList& signers);
std::unique_ptr<KeyArgsList> GetSigners();
private:
GpgContext& ctx_ = GpgContext::GetInstance(
SingletonFunctionObject::GetChannel());
};
} // namespace GpgFrontend
#endif // GPGFRONTEND_ZH_CN_TS_BASICOPERATOR_H
GpgFrontend::GpgBasicOperator
Basic operation collection.
Definition: GpgBasicOperator.h:43
GpgFrontend::SingletonFunctionObject
Definition: GpgFunctionObject.h:148
GpgFrontend::GpgBasicOperator::Decrypt
gpgme_error_t Decrypt(BypeArrayRef in_buffer, ByteArrayPtr &out_buffer, GpgDecrResult &result)
Call the interface provided by gpgme for decryption operation.
Definition: GpgBasicOperator.cpp:64
GpgFrontend
Definition: CoreCommonUtil.cpp:29
GpgFrontend::SingletonFunctionObject< GpgContext >::GetInstance
static GpgContext & GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
Get the Instance object.
Definition: GpgFunctionObject.h:170
GpgFrontend::GpgBasicOperator::DecryptVerify
gpgme_error_t DecryptVerify(BypeArrayRef in_buffer, ByteArrayPtr &out_buffer, GpgDecrResult &decrypt_result, GpgVerifyResult &verify_result)
Call the interface provided by gpgme to perform decryption and verification operations at the same ti...
Definition: GpgBasicOperator.cpp:123
GpgFrontend::check_gpg_error
GPGFRONTEND_CORE_EXPORT GpgError check_gpg_error(GpgError err)
Definition: GpgConstants.cpp:54
GpgFrontend::SingletonFunctionObject::GetChannel
int GetChannel() const
Get the Channel object.
Definition: GpgFunctionObject.h:239
GpgFrontend::GpgBasicOperator::GetSigners
std::unique_ptr< KeyArgsList > GetSigners()
Get a global signature private keys that has been set.
Definition: GpgBasicOperator.cpp:193
GpgFrontend::GpgData
Definition: GpgData.h:39
GpgFrontend::GpgBasicOperator::Verify
gpgme_error_t Verify(BypeArrayRef in_buffer, ByteArrayPtr &sig_buffer, GpgVerifyResult &result) const
Call the interface provided by gpgme for verification operation.
Definition: GpgBasicOperator.cpp:81
GpgFrontend::GpgBasicOperator::Sign
gpg_error_t Sign(KeyListPtr signers, BypeArrayRef in_buffer, ByteArrayPtr &out_buffer, gpgme_sig_mode_t mode, GpgSignResult &result)
Call the interface provided by gpgme for signing operation.
Definition: GpgBasicOperator.cpp:101
GpgFrontend::GpgBasicOperator::SetSigners
void SetSigners(KeyArgsList &signers)
Set the private key for signatures, this operation is a global operation.
Definition: GpgBasicOperator.cpp:178
GpgFrontend::GpgContext
Definition: GpgContext.h:59
GpgFrontend::GpgBasicOperator::GpgBasicOperator
GpgBasicOperator(int channel=SingletonFunctionObject::GetDefaultChannel())
Construct a new Basic Operator object.
Definition: GpgBasicOperator.cpp:35
GpgFrontend::GpgBasicOperator::EncryptSymmetric
gpg_error_t EncryptSymmetric(BypeArrayRef in_buffer, ByteArrayPtr &out_buffer, GpgEncrResult &result)
Call the interface provided by GPGME to symmetrical encryption.
Definition: GpgBasicOperator.cpp:203
GpgFrontend::GpgBasicOperator::EncryptSign
gpgme_error_t EncryptSign(KeyListPtr keys, KeyListPtr signers, BypeArrayRef in_buffer, ByteArrayPtr &out_buffer, GpgEncrResult &encr_result, GpgSignResult &sign_result)
Call the interface provided by gpgme to perform encryption and signature operations at the same time.
Definition: GpgBasicOperator.cpp:144
GpgFrontend::SingletonFunctionObject::GetDefaultChannel
static int GetDefaultChannel()
Get the Default Channel object.
Definition: GpgFunctionObject.h:232
GpgFrontend::GpgData::Read2Buffer
ByteArrayPtr Read2Buffer()
Definition: GpgData.cpp:55
GpgFrontend::GpgBasicOperator::Encrypt
gpg_error_t Encrypt(KeyListPtr keys, BypeArrayRef in_buffer, ByteArrayPtr &out_buffer, GpgEncrResult &result)
Call the interface provided by gpgme for encryption operation.
Definition: GpgBasicOperator.cpp:38
GpgFrontend::GpgKey
Definition: GpgKey.h:41
GpgFrontend::_new_result
GPGFRONTEND_CORE_EXPORT GpgEncrResult _new_result(gpgme_encrypt_result_t &&result)
Definition: GpgConstants.cpp:173