GpgFrontend Project A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.

GpgKeyGetter.h
1
29 #ifndef GPGFRONTEND_ZH_CN_TS_GPGKEYGETTER_H
30 #define GPGFRONTEND_ZH_CN_TS_GPGKEYGETTER_H
31
32 #include "core/GpgContext.h"
33 #include "core/GpgFunctionObject.h"
34 #include "core/GpgModel.h"
35
36 namespace GpgFrontend {
37
42 class GPGFRONTEND_CORE_EXPORT GpgKeyGetter
43 : public SingletonFunctionObject<GpgKeyGetter> {
44 public:
50 explicit GpgKeyGetter(
51 int channel = SingletonFunctionObject::GetDefaultChannel());
52
59 GpgKey GetKey(const std::string& fpr);
60
67 KeyListPtr GetKeys(const KeyIdArgsListPtr& ids);
68
75 GpgKey GetPubkey(const std::string& fpr);
76
82 KeyLinkListPtr FetchKey();
83
90 static KeyListPtr GetKeysCopy(const KeyListPtr& keys);
91
98 static KeyLinkListPtr GetKeysCopy(const KeyLinkListPtr& keys);
99
100 private:
105 GpgContext& ctx_ =
106 GpgContext::GetInstance(SingletonFunctionObject::GetChannel());
107 };
108 } // namespace GpgFrontend
109
110 #endif // GPGFRONTEND_ZH_CN_TS_GPGKEYGETTER_H
GpgFrontend::SingletonFunctionObject
Definition: GpgFunctionObject.h:49
GpgFrontend::GpgKeyGetter::GpgKeyGetter
GpgKeyGetter(int channel=SingletonFunctionObject::GetDefaultChannel())
Construct a new Gpg Key Getter object.
Definition: GpgKeyGetter.cpp:35
GpgFrontend::GpgKeyGetter::GetKeysCopy
static KeyListPtr GetKeysCopy(const KeyListPtr &keys)
Get the Keys Copy object.
Definition: GpgKeyGetter.cpp:97
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:57
GpgFrontend::GpgKeyGetter
Definition: GpgKeyGetter.h:42
GpgFrontend::SingletonFunctionObject::GetChannel
int GetChannel() const
Get the Channel object.
Definition: GpgFunctionObject.h:134
GpgFrontend::GpgKeyGetter::FetchKey
KeyLinkListPtr FetchKey()
Definition: GpgKeyGetter.cpp:58
GpgFrontend::GpgContext
Definition: GpgContext.h:59
GpgFrontend::GpgKeyGetter::GetPubkey
GpgKey GetPubkey(const std::string &fpr)
Get the Pubkey object.
Definition: GpgKeyGetter.cpp:49
GpgFrontend::SingletonFunctionObject::GetDefaultChannel
static int GetDefaultChannel()
Get the Default Channel object.
Definition: GpgFunctionObject.h:127
GpgFrontend::check_gpg_error_2_err_code
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::GpgKeyGetter::GetKey
GpgKey GetKey(const std::string &fpr)
Get the Key object.
Definition: GpgKeyGetter.cpp:38
GpgFrontend::GpgKeyGetter::GetKeys
KeyListPtr GetKeys(const KeyIdArgsListPtr &ids)
Get the Keys object.
Definition: GpgKeyGetter.cpp:83
GpgFrontend::GpgKey
Definition: GpgKey.h:44