GpgKeyOpera.h
#ifndef _GPGKEYOPERA_H
#define _GPGKEYOPERA_H
#include "core/GpgConstants.h"
#include "core/GpgContext.h"
#include "core/GpgModel.h"
namespace GpgFrontend {
class GenKeyInfo;
class GPGFRONTEND_CORE_EXPORT GpgKeyOpera
: public SingletonFunctionObject<GpgKeyOpera> {
public:
explicit GpgKeyOpera(
int channel = SingletonFunctionObject::GetDefaultChannel());
void DeleteKeys(KeyIdArgsListPtr key_ids);
void DeleteKey(const KeyId& key_id);
GpgError SetExpire(const GpgKey& key, const SubkeyId& subkey_fpr,
std::unique_ptr<boost::posix_time::ptime>& expires);
static void GenerateRevokeCert(const GpgKey& key,
const std::string& output_file_name);
GpgFrontend::GpgError ModifyPassword(const GpgKey& key);
GpgFrontend::GpgError ModifyTOFUPolicy(const GpgKey& key,
gpgme_tofu_policy_t tofu_policy);
GpgFrontend::GpgError GenerateKey(const std::unique_ptr<GenKeyInfo>& params,
GpgGenKeyResult& result);
GpgFrontend::GpgError GenerateSubkey(
const GpgKey& key, const std::unique_ptr<GenKeyInfo>& params);
private:
GpgContext& ctx_ =
GpgContext::GetInstance(SingletonFunctionObject::GetChannel());
};
} // namespace GpgFrontend
#endif // _GPGKEYOPERA_H
GpgFrontend::GenKeyInfo::GetUserid
std::string GetUserid() const
Get the Userid object.
Definition: GpgGenKeyInfo.h:114
GpgFrontend::SingletonFunctionObject
Definition: GpgFunctionObject.h:148
GpgFrontend::GpgKeyOpera::GenerateRevokeCert
static void GenerateRevokeCert(const GpgKey &key, const std::string &output_file_name)
Definition: GpgKeyOpera.cpp:105
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:52
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:170
GpgFrontend::check_gpg_error
GPGFRONTEND_CORE_EXPORT GpgError check_gpg_error(GpgError err)
Definition: GpgConstants.cpp:54
GpgFrontend::GpgKeyOpera
Definition: GpgKeyOpera.h:47
GpgFrontend::SingletonFunctionObject::GetChannel
int GetChannel() const
Get the Channel object.
Definition: GpgFunctionObject.h:239
GpgFrontend::GpgKeyOpera::GenerateSubkey
GpgFrontend::GpgError GenerateSubkey(const GpgKey &key, const std::unique_ptr< GenKeyInfo > &params)
Definition: GpgKeyOpera.cpp:244
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:75
GpgFrontend::GpgContext
Definition: GpgContext.h:59
GpgFrontend::GpgKeyOpera::GenerateKey
GpgFrontend::GpgError GenerateKey(const std::unique_ptr< GenKeyInfo > &params, GpgGenKeyResult &result)
Definition: GpgKeyOpera.cpp:165
GpgFrontend::GpgKeyGetter::GetKey
GpgKey GetKey(const std::string &id, bool use_cache=true)
Get the Key object.
Definition: GpgKeyGetter.cpp:47
GpgFrontend::GpgKeyOpera::ModifyPassword
GpgFrontend::GpgError ModifyPassword(const GpgKey &key)
Definition: GpgKeyOpera.cpp:275
GpgFrontend::SingletonFunctionObject::GetDefaultChannel
static int GetDefaultChannel()
Get the Default Channel object.
Definition: GpgFunctionObject.h:232
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:63
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::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:284
GpgFrontend::GpgKey::GetFingerprint
std::string GetFingerprint() const
Definition: GpgKey.cpp:68
GpgFrontend::GpgKey
Definition: GpgKey.h:41
GpgFrontend::_new_result
GPGFRONTEND_CORE_EXPORT GpgEncrResult _new_result(gpgme_encrypt_result_t &&result)
Definition: GpgConstants.cpp:173
GpgFrontend::GpgKeyOpera::DeleteKey
void DeleteKey(const KeyId &key_id)
Definition: GpgKeyOpera.cpp:294
GpgFrontend::GpgKeyOpera::DeleteKeys
void DeleteKeys(KeyIdArgsListPtr key_ids)
Definition: GpgKeyOpera.cpp:51