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

GpgKeyManager.h
1
29 #ifndef GPGFRONTEND_ZH_CN_TS_GPGKEYMANAGER_H
30 #define GPGFRONTEND_ZH_CN_TS_GPGKEYMANAGER_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 GpgKeyManager
43 : public SingletonFunctionObject<GpgKeyManager> {
44 public:
50 explicit GpgKeyManager(
51 int channel = SingletonFunctionObject::GetDefaultChannel());
52
60 bool SignKey(const GpgKey& target, KeyArgsList& keys, const std::string& uid,
61 const std::unique_ptr<boost::posix_time::ptime>& expires);
62
71 bool RevSign(const GpgFrontend::GpgKey& key,
72 const GpgFrontend::SignIdArgsListPtr& signature_id);
73
83 bool SetExpire(const GpgKey& key, std::unique_ptr<GpgSubKey>& subkey,
84 std::unique_ptr<boost::posix_time::ptime>& expires);
85
86 private:
87 GpgContext& ctx_ =
88 GpgContext::GetInstance(SingletonFunctionObject::GetChannel());
89 };
90
91 } // namespace GpgFrontend
92
93 #endif // GPGFRONTEND_ZH_CN_TS_GPGKEYMANAGER_H
GpgFrontend::SingletonFunctionObject
Definition: GpgFunctionObject.h:49
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:57
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:55
GpgFrontend::SingletonFunctionObject::GetChannel
int GetChannel() const
Get the Channel object.
Definition: GpgFunctionObject.h:134
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: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::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:44