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

Public Member Functions

 GpgKeyImportExporter (int channel=SingletonFunctionObject::GetDefaultChannel())
 Construct a new Gpg Key Import Exporter object. More...
 
auto ImportKey (const GFBuffer &) -> std::shared_ptr< GpgImportInformation >
 
auto ExportKey (const GpgKey &key, bool secret, bool ascii, bool shortest, bool ssh_mode=false) const -> std::tuple< GpgError, GFBuffer >
 
void ExportKeys (const KeyArgsList &keys, bool secret, bool ascii, bool shortest, bool ssh_mode, const GpgOperationCallback &cb) const
 
void ExportAllKeys (const KeyArgsList &keys, bool secret, bool ascii, const GpgOperationCallback &cb) const
 
- Public Member Functions inherited from GpgFrontend::SingletonFunctionObject< GpgKeyImportExporter >
 SingletonFunctionObject (const SingletonFunctionObject< GpgKeyImportExporter > &)=delete
 prohibit copy
 
 SingletonFunctionObject (GpgKeyImportExporter &&)=delete
 Construct a new Singleton Function Object object.
 
 SingletonFunctionObject (const GpgKeyImportExporter &)=delete
 Construct a new Singleton Function Object object.
 
auto operator= (const SingletonFunctionObject< GpgKeyImportExporter > &) -> SingletonFunctionObject &=delete
 prohibit copy More...
 
void operator= (const GpgKeyImportExporter &)=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< GpgKeyImportExporter >
static auto GetInstance (int channel=GpgFrontend::kGpgFrontendDefaultChannel) -> GpgKeyImportExporter &
 Get the Instance object. More...
 
static auto CreateInstance (int channel, const std::function< ChannelObjectPtr(void)> &factory) -> GpgKeyImportExporter &
 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< GpgKeyImportExporter >
 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

◆ GpgKeyImportExporter()

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

Construct a new Gpg Key Import Exporter object.

Parameters
channel

Member Function Documentation

◆ ExportAllKeys()

void GpgFrontend::GpgKeyImportExporter::ExportAllKeys ( const KeyArgsList &  keys,
bool  secret,
bool  ascii,
const GpgOperationCallback &  cb 
) const
Parameters
keys
secret
ascii
cbExport keys
keyskeys used
outBufferoutput byte array
Returns
if success

References GpgFrontend::GpgData::Read2GFBuffer(), and GpgFrontend::RunGpgOperaAsync().

◆ ExportKey()

auto GpgFrontend::GpgKeyImportExporter::ExportKey ( const GpgKey key,
bool  secret,
bool  ascii,
bool  shortest,
bool  ssh_mode = false 
) const -> std::tuple<GpgError, GFBuffer>
Parameters
key
secret
ascii
Returns
std::tuple<GpgError, GFBuffer>

Export keys

Parameters
keyskeys used
outBufferoutput byte array
Returns
if success

References GpgFrontend::GpgData::Read2GFBuffer().

◆ ExportKeys()

void GpgFrontend::GpgKeyImportExporter::ExportKeys ( const KeyArgsList &  keys,
bool  secret,
bool  ascii,
bool  shortest,
bool  ssh_mode,
const GpgOperationCallback &  cb 
) const
Parameters
keys
outBuffer
secret
Returns
true
false

Export keys

Parameters
keyskeys used
outBufferoutput byte array
Returns
if success

References GpgFrontend::GpgData::Read2GFBuffer(), and GpgFrontend::RunGpgOperaAsync().

◆ ImportKey()

auto GpgFrontend::GpgKeyImportExporter::ImportKey ( const GFBuffer in_buffer) -> std::shared_ptr<GpgImportInformation>
Parameters
inBuffer
Returns
GpgImportInformation

Import key pair

Parameters
inBufferinput byte array
Returns
Import information

References GpgFrontend::CheckGpgError().


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