GpgKeyManager.h
#ifndef GPGFRONTEND_ZH_CN_TS_GPGKEYMANAGER_H
#define GPGFRONTEND_ZH_CN_TS_GPGKEYMANAGER_H
#include "core/GpgContext.h"
#include "core/GpgFunctionObject.h"
#include "core/GpgModel.h"
namespace GpgFrontend {
class GPGFRONTEND_CORE_EXPORT GpgKeyManager
: public SingletonFunctionObject<GpgKeyManager> {
public:
explicit GpgKeyManager(
int channel = SingletonFunctionObject::GetDefaultChannel());
bool SignKey(const GpgKey& target, KeyArgsList& keys, const std::string& uid,
const std::unique_ptr<boost::posix_time::ptime>& expires);
bool RevSign(const GpgFrontend::GpgKey& key,
const GpgFrontend::SignIdArgsListPtr& signature_id);
bool SetExpire(const GpgKey& key, std::unique_ptr<GpgSubKey>& subkey,
std::unique_ptr<boost::posix_time::ptime>& expires);
private:
GpgContext& ctx_ =
GpgContext::GetInstance(SingletonFunctionObject::GetChannel());
};
} // namespace GpgFrontend
#endif // GPGFRONTEND_ZH_CN_TS_GPGKEYMANAGER_H
GpgFrontend::SingletonFunctionObject
Definition: GpgFunctionObject.h:148
GpgFrontend
Definition: CoreCommonUtil.cpp:29
GpgFrontend::SingletonFunctionObject< GpgBasicOperator >::GetInstance
static GpgBasicOperator & GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
Get the Instance object.
Definition: GpgFunctionObject.h:170
GpgFrontend::GpgKeyManager::SetExpire
bool SetExpire(const GpgKey &key, std::unique_ptr< GpgSubKey > &subkey, std::unique_ptr< boost::posix_time::ptime > &expires)
Set the Expire object.
Definition: GpgKeyManager.cpp:78
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::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::GpgKeyManager::SignKey
bool SignKey(const GpgKey &target, KeyArgsList &keys, const std::string &uid, const std::unique_ptr< boost::posix_time::ptime > &expires)
Sign a key pair(actually a certain uid)
Definition: GpgKeyManager.cpp:40
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::GpgKeyManager::GpgKeyManager
GpgKeyManager(int channel=SingletonFunctionObject::GetDefaultChannel())
Construct a new Gpg Key Manager object.
Definition: GpgKeyManager.cpp:37
GpgFrontend::GpgKeyManager
Definition: GpgKeyManager.h:42
GpgFrontend::GpgKeyManager::RevSign
bool RevSign(const GpgFrontend::GpgKey &key, const GpgFrontend::SignIdArgsListPtr &signature_id)
Definition: GpgKeyManager.cpp:62
GpgFrontend::GpgKey
Definition: GpgKey.h:41