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

give the possibility to import or export a key package More...

#include <KeyPackageOperator.h>

Collaboration diagram for GpgFrontend::KeyPackageOperator:
Collaboration graph

Static Public Member Functions

static bool GeneratePassphrase (const std::filesystem::path &phrase_path, std::string &phrase)
 generate passphrase for key package and save it to file More...
static std::string GenerateKeyPackageName ()
 generate the name of the key package More...
static bool GenerateKeyPackage (const std::filesystem::path &key_package_path, const std::string &key_package_name, KeyIdArgsListPtr &key_ids, std::string &phrase, bool secret)
 generate key package More...
static bool ImportKeyPackage (const std::filesystem::path &key_package_path, const std::filesystem::path &phrase_path, GpgFrontend::GpgImportInformation &import_info)
 import key package More...

Static Private Member Functions

static std::string generate_key_package_name ()
 generate key package name More...

Detailed Description

give the possibility to import or export a key package

Member Function Documentation

◆ generate_key_package_name()

static std::string GpgFrontend::KeyPackageOperator::generate_key_package_name ( )

generate key package name

std::string key package name

< Random device

< Mersenne twister

Referenced by GenerateKeyPackageName().

◆ GenerateKeyPackage()

bool GpgFrontend::KeyPackageOperator::GenerateKeyPackage ( const std::filesystem::path &  key_package_path,
const std::string &  key_package_name,
KeyIdArgsListPtr &  key_ids,
std::string &  phrase,
bool  secret 

generate key package

key_package_pathpath to key package
key_package_namename of the key package
key_idskey ids to export
phrasepassphrase to encrypt key package
secrettrue if secret key should be exported
true if key package was generated
false if key package was not generated

References GpgFrontend::SingletonFunctionObject< GpgKeyImportExporter >::GetInstance(), and GpgFrontend::FileOperator::WriteFileStd().

◆ GenerateKeyPackageName()

std::string GpgFrontend::KeyPackageOperator::GenerateKeyPackageName ( )

generate the name of the key package

std::string name of the key package

References generate_key_package_name().

Referenced by GpgFrontend::UI::ExportKeyPackageDialog::ExportKeyPackageDialog().

◆ GeneratePassphrase()

bool GpgFrontend::KeyPackageOperator::GeneratePassphrase ( const std::filesystem::path &  phrase_path,
std::string &  phrase 

generate passphrase for key package and save it to file

phrase_pathpath to passphrase file
phrasepassphrase generated
true if passphrase was generated and saved
false if passphrase was not generated and saved

References GpgFrontend::PassphraseGenerator::Generate(), GpgFrontend::SingletonFunctionObject< PassphraseGenerator >::GetInstance(), and GpgFrontend::FileOperator::WriteFileStd().

◆ ImportKeyPackage()

bool GpgFrontend::KeyPackageOperator::ImportKeyPackage ( const std::filesystem::path &  key_package_path,
const std::filesystem::path &  phrase_path,
GpgFrontend::GpgImportInformation import_info 

import key package

key_package_pathpath to key package
phrase_pathpath to passphrase file
import_infoimport info
true if key package was imported
false if key package was not imported

References GpgFrontend::SingletonFunctionObject< GpgKeyImportExporter >::GetInstance(), GpgFrontend::GpgKeyImportExporter::ImportKey(), and GpgFrontend::FileOperator::ReadFileStd().

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