GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgFrontend::GpgKeyOpera Class Reference
Inheritance diagram for GpgFrontend::GpgKeyOpera:
Inheritance graph
Collaboration diagram for GpgFrontend::GpgKeyOpera:
Collaboration graph

Public Member Functions

 GpgKeyOpera (int channel=SingletonFunctionObject::GetDefaultChannel())
 Construct a new Gpg Key Opera object. More...
 
void DeleteKeys (KeyIdArgsListPtr key_ids)
 
void DeleteKey (const KeyId &key_id)
 
auto SetExpire (const GpgKey &key, const SubkeyId &subkey_fpr, std::unique_ptr< QDateTime > &expires) -> GpgError
 Set the Expire object. More...
 
void GenerateRevokeCert (const GpgKey &key, const QString &output_path)
 
void ModifyPassword (const GpgKey &key, const GpgOperationCallback &)
 
auto ModifyTOFUPolicy (const GpgKey &key, gpgme_tofu_policy_t tofu_policy) -> GpgFrontend::GpgError
 
void GenerateKey (const std::shared_ptr< GenKeyInfo > &, const GpgOperationCallback &)
 
auto GenerateKeySync (const std::shared_ptr< GenKeyInfo > &params) -> std::tuple< GpgError, DataObjectPtr >
 
void GenerateSubkey (const GpgKey &key, const std::shared_ptr< GenKeyInfo > &params, const GpgOperationCallback &)
 
auto GenerateSubkeySync (const GpgKey &key, const std::shared_ptr< GenKeyInfo > &params) -> std::tuple< GpgError, DataObjectPtr >
 
void GenerateKeyWithSubkey (const std::shared_ptr< GenKeyInfo > &params, const std::shared_ptr< GenKeyInfo > &subkey_params, const GpgOperationCallback &callback)
 
auto GenerateKeyWithSubkeySync (const std::shared_ptr< GenKeyInfo > &params, const std::shared_ptr< GenKeyInfo > &subkey_params) -> std::tuple< GpgError, DataObjectPtr >
 
- Public Member Functions inherited from GpgFrontend::SingletonFunctionObject< GpgKeyOpera >
 SingletonFunctionObject (const SingletonFunctionObject< GpgKeyOpera > &)=delete
 prohibit copy
 
 SingletonFunctionObject (GpgKeyOpera &&)=delete
 Construct a new Singleton Function Object object.
 
 SingletonFunctionObject (const GpgKeyOpera &)=delete
 Construct a new Singleton Function Object object.
 
auto operator= (const SingletonFunctionObject< GpgKeyOpera > &) -> SingletonFunctionObject &=delete
 prohibit copy More...
 
void operator= (const GpgKeyOpera &)=delete
 
auto GetChannel () const -> int
 Get the Channel object. More...
 
- Public Member Functions inherited from GpgFrontend::ChannelObject
 ChannelObject () noexcept
 Construct a new Default Channel Object object.
 
virtual ~ChannelObject () noexcept
 Destroy the Channel Object object.
 
 ChannelObject (int channel, QString type)
 Construct a new Channel Object object. More...
 
auto GetChannel () const -> int
 Get the Channel object. More...
 
void SetChannel (int channel)
 Set the Channel object. More...
 

Private Attributes

GpgContextctx_
 

Additional Inherited Members

- Static Public Member Functions inherited from GpgFrontend::SingletonFunctionObject< GpgKeyOpera >
static auto GetInstance (int channel=GpgFrontend::kGpgFrontendDefaultChannel) -> GpgKeyOpera &
 Get the Instance object. More...
 
static auto CreateInstance (int channel, const std::function< ChannelObjectPtr(void)> &factory) -> GpgKeyOpera &
 Create a Instance object. More...
 
static void ReleaseChannel (int channel)
 
static auto GetDefaultChannel () -> int
 Get the Default Channel object. More...
 
static auto GetAllChannelId () -> std::vector< int >
 Get all the channel ids. More...
 
- Static Public Member Functions inherited from GpgFrontend::ChannelObject
static auto GetDefaultChannel () -> int
 Get the Default Channel object. More...
 
- Protected Member Functions inherited from GpgFrontend::SingletonFunctionObject< GpgKeyOpera >
 SingletonFunctionObject ()=default
 Construct a new Singleton Function Object object.
 
 SingletonFunctionObject (int channel)
 Construct a new Singleton Function Object object. More...
 
virtual ~SingletonFunctionObject ()=default
 Destroy the Singleton Function Object object.
 

Constructor & Destructor Documentation

◆ GpgKeyOpera()

GpgFrontend::GpgKeyOpera::GpgKeyOpera ( int  channel = SingletonFunctionObject::GetDefaultChannel())
explicit

Construct a new Gpg Key Opera object.

Parameters
channel

Member Function Documentation

◆ DeleteKey()

void GpgFrontend::GpgKeyOpera::DeleteKey ( const KeyId &  key_id)
Parameters
key_id

References DeleteKeys().

◆ DeleteKeys()

void GpgFrontend::GpgKeyOpera::DeleteKeys ( KeyIdArgsListPtr  key_ids)
Parameters
key_idsDelete keys
uidListkey ids

References GpgFrontend::CheckGpgError(), and GpgFrontend::SingletonFunctionObject< GpgKeyGetter >::GetInstance().

Referenced by DeleteKey().

◆ GenerateKey()

void GpgFrontend::GpgKeyOpera::GenerateKey ( const std::shared_ptr< GenKeyInfo > &  params,
const GpgOperationCallback &  callback 
)
Parameters
params
result
Returns
GpgFrontend::GpgError

Generate a new key pair

Parameters
paramskey generation args
Returns
error information

References GpgFrontend::CheckGpgError(), and GpgFrontend::RunGpgOperaAsync().

◆ GenerateKeySync()

auto GpgFrontend::GpgKeyOpera::GenerateKeySync ( const std::shared_ptr< GenKeyInfo > &  params) -> std::tuple<GpgError, DataObjectPtr>

◆ GenerateKeyWithSubkey()

void GpgFrontend::GpgKeyOpera::GenerateKeyWithSubkey ( const std::shared_ptr< GenKeyInfo > &  params,
const std::shared_ptr< GenKeyInfo > &  subkey_params,
const GpgOperationCallback &  callback 
)

◆ GenerateKeyWithSubkeySync()

auto GpgFrontend::GpgKeyOpera::GenerateKeyWithSubkeySync ( const std::shared_ptr< GenKeyInfo > &  params,
const std::shared_ptr< GenKeyInfo > &  subkey_params 
) -> std::tuple<GpgError, DataObjectPtr>

◆ GenerateRevokeCert()

void GpgFrontend::GpgKeyOpera::GenerateRevokeCert ( const GpgKey key,
const QString &  output_path 
)
Parameters
key
output_file_nameGenerate revoke cert of a key pair
keytarget key pair
outputFileNameout file name(path)
Returns
the process doing this job

References GpgFrontend::GpgCommandExecutor::ExecuteSync(), and GpgFrontend::GpgKey::GetFingerprint().

◆ GenerateSubkey()

void GpgFrontend::GpgKeyOpera::GenerateSubkey ( const GpgKey key,
const std::shared_ptr< GenKeyInfo > &  params,
const GpgOperationCallback &  callback 
)

◆ GenerateSubkeySync()

auto GpgFrontend::GpgKeyOpera::GenerateSubkeySync ( const GpgKey key,
const std::shared_ptr< GenKeyInfo > &  params 
) -> std::tuple<GpgError, DataObjectPtr>
Parameters
key
params

References GpgFrontend::CheckGpgError(), and GpgFrontend::RunGpgOperaSync().

◆ ModifyPassword()

void GpgFrontend::GpgKeyOpera::ModifyPassword ( const GpgKey key,
const GpgOperationCallback &  callback 
)
Parameters
key
Returns
GpgFrontend::GpgError

References GpgFrontend::RunGpgOperaAsync().

◆ ModifyTOFUPolicy()

auto GpgFrontend::GpgKeyOpera::ModifyTOFUPolicy ( const GpgKey key,
gpgme_tofu_policy_t  tofu_policy 
) -> GpgFrontend::GpgError

◆ SetExpire()

auto GpgFrontend::GpgKeyOpera::SetExpire ( const GpgKey key,
const SubkeyId &  subkey_fpr,
std::unique_ptr< QDateTime > &  expires 
) -> GpgError

Set the Expire object.

Parameters
key
subkey_fpr
expires
Returns
GpgError

Set the expire date and time of a key pair(actually the primary key) or subkey

Parameters
keytarget key pair
subkeynull if primary key
expiresdate and time
Returns
if successful

Member Data Documentation

◆ ctx_

GpgContext& GpgFrontend::GpgKeyOpera::ctx_
private
Initial value:
=
auto GetChannel() const -> int
Get the Channel object.
Definition: GpgFunctionObject.h:140
static auto GetInstance(int channel=GpgFrontend::kGpgFrontendDefaultChannel) -> GpgContext &
Get the Instance object.
Definition: GpgFunctionObject.h:80

The documentation for this class was generated from the following files: