GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgFrontend::GpgContext Class Reference
Inheritance diagram for GpgFrontend::GpgContext:
Inheritance graph
Collaboration diagram for GpgFrontend::GpgContext:
Collaboration graph

Classes

struct  _ctx_ref_deleter
 

Signals

void SignalNeedUserInputPassphrase ()
 

Public Member Functions

 GpgContext (const GpgContextInitArgs &args={})
 Construct a new Gpg Context object. More...
 
 GpgContext (int channel)
 Construct a new Gpg Context object. More...
 
 ~GpgContext () override=default
 Destroy the Gpg Context object.
 
bool good () const
 
const GpgInfoGetInfo (bool refresh=false)
 Get the Info object. More...
 
 operator gpgme_ctx_t () const
 
void SetPassphraseCb (gpgme_passphrase_cb_t func) const
 Set the Passphrase Cb object. More...
 
- Public Member Functions inherited from GpgFrontend::SingletonFunctionObject< GpgContext >
 SingletonFunctionObject (const SingletonFunctionObject< GpgContext > &)=delete
 prohibit copy
 
 SingletonFunctionObject (GpgContext &&)=delete
 Construct a new Singleton Function Object object.
 
 SingletonFunctionObject (const GpgContext &)=delete
 Construct a new Singleton Function Object object.
 
SingletonFunctionObjectoperator= (const SingletonFunctionObject< GpgContext > &)=delete
 prohibit copy More...
 
void operator= (const GpgContext &)=delete
 
int GetChannel () const
 Get the Channel object. More...
 
- Public Member Functions inherited from GpgFrontend::ChannelObject
 ChannelObject () noexcept
 Construct a new Default Channel Object object.
 
 ChannelObject (int channel)
 Construct a new Channel Object object. More...
 
int GetChannel () const
 Get the Channel object. More...
 
void SetChannel (int channel)
 Set the Channel object. More...
 

Static Public Member Functions

static gpgme_error_t test_passphrase_cb (void *opaque, const char *uid_hint, const char *passphrase_info, int last_was_bad, int fd)
 
static gpgme_error_t custom_passphrase_cb (void *opaque, const char *uid_hint, const char *passphrase_info, int last_was_bad, int fd)
 
static gpgme_error_t test_status_cb (void *hook, const char *keyword, const char *args)
 
- Static Public Member Functions inherited from GpgFrontend::SingletonFunctionObject< GpgContext >
static GpgContextGetInstance (int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
 Get the Instance object. More...
 
static GpgContextCreateInstance (int channel, std::function< std::unique_ptr< ChannelObject >(void)> factory)
 Create a Instance object. More...
 
static void ReleaseChannel (int channel)
 
static int GetDefaultChannel ()
 Get the Default Channel object. More...
 
static std::vector< int > GetAllChannelId ()
 Get all the channel ids. More...
 
- Static Public Member Functions inherited from GpgFrontend::ChannelObject
static int GetDefaultChannel ()
 Get the Default Channel object. More...
 

Private Types

using CtxRefHandler = std::unique_ptr< struct gpgme_context, _ctx_ref_deleter >
 

Private Member Functions

void post_init_ctx ()
 
std::string need_user_input_passphrase ()
 
std::optional< std::string > check_binary_chacksum (std::filesystem::path)
 Construct a new std::check component existence object.
 

Private Attributes

GpgInfo info_ {}
 
GpgContextInitArgs args_ {}
 
bool extend_info_loaded_ = false
 
std::shared_mutex preload_lock_ {}
 
CtxRefHandler _ctx_ref = nullptr
 
bool good_ = true
 

Additional Inherited Members

- Protected Member Functions inherited from GpgFrontend::SingletonFunctionObject< GpgContext >
 SingletonFunctionObject ()=default
 Construct a new Singleton Function Object object.
 
 SingletonFunctionObject (int channel)
 Construct a new Singleton Function Object object. More...
 
virtual ~SingletonFunctionObject ()=default
 Destroy the Singleton Function Object object.
 

Constructor & Destructor Documentation

◆ GpgContext() [1/2]

◆ GpgContext() [2/2]

GpgFrontend::GpgContext::GpgContext ( int  channel)
explicit

Construct a new Gpg Context object.

Parameters
channel

Member Function Documentation

◆ custom_passphrase_cb()

gpgme_error_t GpgFrontend::GpgContext::custom_passphrase_cb ( void *  opaque,
const char *  uid_hint,
const char *  passphrase_info,
int  last_was_bad,
int  fd 
)
static

◆ GetInfo()

◆ good()

bool GpgFrontend::GpgContext::good ( ) const
Returns
true
false

◆ need_user_input_passphrase()

std::string GpgFrontend::GpgContext::need_user_input_passphrase ( )
private
Returns
std::string

References GpgFrontend::CoreSignalStation::GetInstance().

Referenced by custom_passphrase_cb().

◆ operator gpgme_ctx_t()

GpgFrontend::GpgContext::operator gpgme_ctx_t ( ) const
inline
Returns
gpgme_ctx_t

◆ post_init_ctx()

void GpgFrontend::GpgContext::post_init_ctx ( )
private

◆ SetPassphraseCb()

void GpgFrontend::GpgContext::SetPassphraseCb ( gpgme_passphrase_cb_t  func) const

Set the Passphrase Cb object.

Parameters
func

References GpgFrontend::GpgInfo::GnupgVersion.

Referenced by post_init_ctx().

◆ test_passphrase_cb()

gpgme_error_t GpgFrontend::GpgContext::test_passphrase_cb ( void *  opaque,
const char *  uid_hint,
const char *  passphrase_info,
int  last_was_bad,
int  fd 
)
static
Parameters
opaque
uid_hint
passphrase_info
last_was_bad
fd
Returns
gpgme_error_t

Referenced by post_init_ctx().

◆ test_status_cb()

gpgme_error_t GpgFrontend::GpgContext::test_status_cb ( void *  hook,
const char *  keyword,
const char *  args 
)
static
Parameters
hook
keyword
args
Returns
gpgme_error_t

Referenced by post_init_ctx().


The documentation for this class was generated from the following files: