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

GpgKeyOpera.h
1
29 #ifndef _GPGKEYOPERA_H
30 #define _GPGKEYOPERA_H
31
32 #include "core/GpgConstants.h"
33 #include "core/GpgContext.h"
34 #include "core/GpgModel.h"
35
36 namespace GpgFrontend {
41 class GenKeyInfo;
42
47 class GPGFRONTEND_CORE_EXPORT GpgKeyOpera
48 : public SingletonFunctionObject<GpgKeyOpera> {
49 public:
55 explicit GpgKeyOpera(
56 int channel = SingletonFunctionObject::GetDefaultChannel());
57
63 void DeleteKeys(KeyIdArgsListPtr key_ids);
64
70 void DeleteKey(const KeyId& key_id);
71
80 GpgError SetExpire(const GpgKey& key, const SubkeyId& subkey_fpr,
81 std::unique_ptr<boost::posix_time::ptime>& expires);
82
89 static void GenerateRevokeCert(const GpgKey& key,
90 const std::string& output_file_name);
91
98 GpgFrontend::GpgError ModifyPassword(const GpgKey& key);
99
107 GpgFrontend::GpgError ModifyTOFUPolicy(const GpgKey& key,
108 gpgme_tofu_policy_t tofu_policy);
116 GpgFrontend::GpgError GenerateKey(const std::unique_ptr<GenKeyInfo>& params,
117 GpgGenKeyResult& result);
118
126 GpgFrontend::GpgError GenerateSubkey(
127 const GpgKey& key, const std::unique_ptr<GenKeyInfo>& params);
128
129 private:
130 GpgContext& ctx_ =
131 GpgContext::GetInstance(SingletonFunctionObject::GetChannel());
132 };
133 } // namespace GpgFrontend
134
135 #endif // _GPGKEYOPERA_H
GpgFrontend::GenKeyInfo::GetUserid
std::string GetUserid() const
Get the Userid object.
Definition: GpgGenKeyInfo.h:114
GpgFrontend::SingletonFunctionObject
Definition: GpgFunctionObject.h:49
GpgFrontend::GpgKeyOpera::GenerateRevokeCert
static void GenerateRevokeCert(const GpgKey &key, const std::string &output_file_name)
Definition: GpgKeyOpera.cpp:106
GpgFrontend::GenKeyInfo::GetAlgo
const std::string & GetAlgo() const
Get the Algo object.
Definition: GpgGenKeyInfo.h:167
GpgFrontend::GpgKey::GetId
std::string GetId() const
Definition: GpgKey.cpp:54
GpgFrontend
Definition: CoreCommonUtil.cpp:29
GpgFrontend::SingletonFunctionObject< GpgKeyGetter >::GetInstance
static GpgKeyGetter & GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
Get the Instance object.
Definition: GpgFunctionObject.h:57
GpgFrontend::check_gpg_error
GPGFRONTEND_CORE_EXPORT GpgError check_gpg_error(GpgError err)
Definition: GpgConstants.cpp:55
GpgFrontend::GpgKeyOpera
Definition: GpgKeyOpera.h:47
GpgFrontend::SingletonFunctionObject::GetChannel
int GetChannel() const
Get the Channel object.
Definition: GpgFunctionObject.h:134
GpgFrontend::GpgKeyOpera::GenerateSubkey
GpgFrontend::GpgError GenerateSubkey(const GpgKey &key, const std::unique_ptr< GenKeyInfo > &params)
Definition: GpgKeyOpera.cpp:245
GpgFrontend::GpgKeyOpera::SetExpire
GpgError SetExpire(const GpgKey &key, const SubkeyId &subkey_fpr, std::unique_ptr< boost::posix_time::ptime > &expires)
Set the Expire object.
Definition: GpgKeyOpera.cpp:76
GpgFrontend::GpgContext
Definition: GpgContext.h:59
GpgFrontend::GpgKeyOpera::GenerateKey
GpgFrontend::GpgError GenerateKey(const std::unique_ptr< GenKeyInfo > &params, GpgGenKeyResult &result)
Definition: GpgKeyOpera.cpp:166
GpgFrontend::GpgKeyOpera::ModifyPassword
GpgFrontend::GpgError ModifyPassword(const GpgKey &key)
Definition: GpgKeyOpera.cpp:276
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::GenKeyInfo::GetKeySizeStr
std::string GetKeySizeStr() const
Get the Key Size Str object.
Definition: GpgGenKeyInfo.cpp:154
GpgFrontend::GenKeyInfo::IsSubKey
bool IsSubKey() const
Definition: GpgGenKeyInfo.h:100
GpgFrontend::GpgKeyOpera::GpgKeyOpera
GpgKeyOpera(int channel=SingletonFunctionObject::GetDefaultChannel())
Construct a new Gpg Key Opera object.
Definition: GpgKeyOpera.cpp:44
GpgFrontend::GpgKeyGetter::GetKey
GpgKey GetKey(const std::string &fpr)
Get the Key object.
Definition: GpgKeyGetter.cpp:38
GpgFrontend::GpgCommandExecutor::Execute
void Execute(StringArgsRef arguments, const std::function< void(boost::process::async_pipe &in, boost::process::async_pipe &out)> &interact_func)
Excuting an order.
Definition: GpgCommandExecutor.cpp:41
GpgFrontend::GpgKeyOpera::ModifyTOFUPolicy
GpgFrontend::GpgError ModifyTOFUPolicy(const GpgKey &key, gpgme_tofu_policy_t tofu_policy)
Definition: GpgKeyOpera.cpp:285
GpgFrontend::GpgKey::GetFingerprint
std::string GetFingerprint() const
Definition: GpgKey.cpp:70
GpgFrontend::GpgKey
Definition: GpgKey.h:44
GpgFrontend::_new_result
GPGFRONTEND_CORE_EXPORT GpgEncrResult _new_result(gpgme_encrypt_result_t &&result)
Definition: GpgConstants.cpp:191
GpgFrontend::GpgKeyOpera::DeleteKey
void DeleteKey(const KeyId &key_id)
Definition: GpgKeyOpera.cpp:295
GpgFrontend::GpgKeyOpera::DeleteKeys
void DeleteKeys(KeyIdArgsListPtr key_ids)
Definition: GpgKeyOpera.cpp:52