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

Namespaces

 Module
 
 RawAPI
 
 Test
 
 Thread
 
 UI
 

Classes

struct  ArchiveReadClientData
 
class  ArchiveFileOperator
 
class  ChannelObject
 object which in channel system is called "channel" More...
 
class  SingletonFunctionObject
 
class  SingletonStorage
 
class  SingletonStorageCollection
 
class  ThreadSafeMap
 
class  CacheManager
 
class  CoreSignalStation
 
class  DataObjectOperator
 
class  GlobalSettingStation
 Singleton class for managing global settings in the application. More...
 
class  GpgAdvancedOperator
 
class  GpgBasicOperator
 Basic operation collection. More...
 
class  GpgCommandExecutor
 Extra commands related to GPG. More...
 
struct  GpgContextInitArgs
 
class  GpgContext
 
class  GpgFileOpera
 
class  GpgKeyGetter
 
class  GpgKeyImportExporter
 
class  GpgKeyManager
 
class  GpgKeyOpera
 
class  GpgUIDOperator
 
class  KeyPackageOperator
 give the possibility to import or export a key package More...
 
class  LoggerManager
 
class  PassphraseGenerator
 The PassphraseGenerator class. More...
 
class  GpgDecryptResultAnalyse
 
class  GpgEncryptResultAnalyse
 
class  GpgResultAnalyse
 
class  GpgSignResultAnalyse
 
class  GpgVerifyResultAnalyse
 
class  SecureMemoryAllocator
 
struct  SecureObjectDeleter
 
struct  CoreInitArgs
 
struct  RefDeleter
 
class  DataObject
 
class  GFBuffer
 
class  GFDataExchanger
 
class  GpgData
 
class  GpgDecryptResult
 
class  GpgEncryptResult
 
class  GpgGenerateKeyResult
 
class  GenKeyInfo
 
class  GpgImportInformation
 
class  GpgKey
 
class  GpgKeySignature
 
class  GpgPassphraseContext
 
struct  GpgRecipient
 
class  GpgSignature
 
class  GpgSignResult
 
class  GpgSubKey
 
class  GpgTOFUInfo
 
class  GpgUID
 
class  GpgVerifyResult
 
class  PointerConverter
 
struct  GpgFrontendContext
 

Typedefs

using ChannelObjectPtr = SecureUniquePtr< ChannelObject >
 
using SingletonStoragePtr = std::unique_ptr< SingletonStorage, SecureObjectDeleter< SingletonStorage > >
 
using GpgCommandExecutorCallback = std::function< void(int, QString, QString)>
 
using GpgCommandExecutorInteractor = std::function< void(QProcess *)>
 
template<typename T >
using SecureUniquePtr = std::unique_ptr< T, SecureObjectDeleter< T > >
 
template<typename T >
using KeyRefHandler = std::unique_ptr< T, RefDeleter< T > >
 
using DataObjectPtr = std::shared_ptr< DataObject >
 
using GFError = uint32_t
 
using ByteArray = QByteArray
 
using ByteArrayPtr = std::shared_ptr< ByteArray >
 
using StdBypeArrayPtr = std::shared_ptr< ByteArray >
 
using BypeArrayRef = ByteArray &
 
using ConstBypeArrayRef = const ByteArray &
 
using BypeArrayConstRef = const ByteArray &
 
using StringArgsPtr = std::unique_ptr< std::vector< QString > >
 
using StringArgsRef = std::vector< QString > &
 
using OperaRunnable = std::function< GFError(DataObjectPtr)>
 
using OperationCallback = std::function< void(GFError, DataObjectPtr)>
 
using GpgError = gpgme_error_t
 gpgme error
 
using GpgErrorCode = gpg_err_code_t
 
using GpgErrorDesc = std::pair< QString, QString >
 
using KeyId = QString
 
using SubkeyId = QString
 
using KeyIdArgsList = std::vector< KeyId >
 
using KeyIdArgsListPtr = std::unique_ptr< KeyIdArgsList >
 
using UIDArgsList = std::vector< QString >
 
using UIDArgsListPtr = std::unique_ptr< UIDArgsList >
 
using SignIdArgsList = std::vector< std::pair< QString, QString > >
 
using SignIdArgsListPtr = std::unique_ptr< SignIdArgsList >
 
using KeyFprArgsListPtr = std::unique_ptr< std::vector< QString > >
 
using KeyArgsList = std::vector< GpgKey >
 
using KeyListPtr = std::shared_ptr< KeyArgsList >
 
using GpgKeyLinkList = std::list< GpgKey >
 
using KeyLinkListPtr = std::unique_ptr< GpgKeyLinkList >
 
using KeyPtr = std::unique_ptr< GpgKey >
 
using KeyPtrArgsList = const std::initializer_list< KeyPtr >
 
using GpgSignMode = gpgme_sig_mode_t
 
using GpgOperaRunnable = std::function< GpgError(DataObjectPtr)>
 
using GpgOperationCallback = std::function< void(GpgError, DataObjectPtr)>
 
using GpgOperationFuture = std::future< std::tuple< GpgError, DataObjectPtr > >
 
using GFCxtWPtr = std::weak_ptr< GpgFrontendContext >
 
using GFCxtSPtr = std::shared_ptr< GpgFrontendContext >
 

Enumerations

enum  GpgOperation {
  kENCRYPT , kDECRYPT , kSIGN , kVERIFY ,
  kENCRYPT_SIGN , kDECRYPT_VERIFY
}
 

Functions

auto StartApplication (const GFCxtWPtr &p_ctx) -> int
 
auto PrintVersion () -> int
 
auto ParseLogLevel (const QString &log_level) -> spdlog::level::level_enum
 
auto RunTest (const GFCxtWPtr &p_ctx) -> int
 
auto CopyData (struct archive *ar, struct archive *aw) -> int
 
auto ArchiveReadCallback (struct archive *, void *client_data, const void **buffer) -> ssize_t
 
auto ArchiveWriteCallback (struct archive *, void *client_data, const void *buffer, size_t length) -> ssize_t
 
auto ArchiveCloseWriteCallback (struct archive *, void *client_data) -> int
 
template<typename Derived >
auto ConvertToChannelObjectPtr (std::unique_ptr< Derived, SecureObjectDeleter< Derived >> derivedPtr) -> std::unique_ptr< ChannelObject, SecureObjectDeleter< ChannelObject >>
 
auto GetGlobalFunctionObjectChannelLock (const std::type_info &type, int channel) -> std::mutex &
 
auto GetGlobalFunctionObjectTypeLock (const std::type_info &type) -> std::mutex &
 
auto GetChannelObjectInstance (const std::type_info &type, int channel) -> ChannelObject *
 Get the Instance object. More...
 
auto CreateChannelObjectInstance (const std::type_info &type, int channel, SecureUniquePtr< ChannelObject > channel_object) -> ChannelObject *
 
auto BuildTaskFromExecCtx (const GpgCommandExecutor::ExecuteContext &context) -> Thread::Task *
 
void DestroyGpgFrontendCore ()
 
auto VerifyGpgconfPath (const QFileInfo &gnupg_install_fs_path) -> bool
 
auto VerifyKeyDatabasePath (const QFileInfo &key_database_fs_path) -> bool
 
auto SearchGpgconfPath (const QList< QString > &candidate_paths) -> QString
 
auto SearchKeyDatabasePath (const QList< QString > &candidate_paths) -> QString
 
auto InitGpgME (const QString &gpgconf_path, const QString &gnupg_path) -> bool
 
auto GetGnuPGPathByGpgConf (const QString &gnupg_install_fs_path) -> QString
 
auto DetectGpgConfPath () -> QString
 
auto DetectGnuPGPath (QString gpgconf_path) -> QString
 
void InitGpgFrontendCore (CoreInitArgs)
 
void swap (DataObject &a, DataObject &b) noexcept
 
template<typename... Args>
auto TransferParams (Args &&... args) -> std::shared_ptr< DataObject >
 
template<typename T >
auto ExtractParams (const std::shared_ptr< DataObject > &d_o, int index) -> T
 
auto GFReadExCb (void *handle, void *buffer, size_t size) -> ssize_t
 
auto GFWriteExCb (void *handle, const void *buffer, size_t size) -> ssize_t
 
void GFReleaseExCb (void *handle)
 
auto RunGpgOperaAsync (const GpgOperaRunnable &runnable, const GpgOperationCallback &callback, const QString &operation, const QString &minial_version) -> Thread::Task::TaskHandler
 
auto RunGpgOperaSync (const GpgOperaRunnable &runnable, const QString &operation, const QString &minial_version) -> std::tuple< GpgError, DataObjectPtr >
 
auto RunIOOperaAsync (const OperaRunnable &runnable, const OperationCallback &callback, const QString &operation) -> Thread::Task::TaskHandler
 
auto RunOperaAsync (const OperaRunnable &runnable, const OperationCallback &callback, const QString &operation) -> Thread::Task::TaskHandler
 
void SetCacheValue (const QString &key, QString value)
 set a temp cache under a certain key
 
auto GetCacheValue (const QString &key) -> QString
 after get the temp cache, its value will be imediately ease in storage More...
 
void ResetCacheValue (const QString &)
 imediately ease temp cache in storage More...
 
auto BeautifyFingerprint (QString fingerprint) -> QString
 
auto CompareSoftwareVersion (const QString &a, const QString &b) -> int
 
auto GetOnlyFileNameWithPath (const QString &path) -> QString
 Get the only file name with path object. More...
 
auto GetFileExtension (const QString &path) -> QString
 Get the file extension object. More...
 
auto GetFileSizeByPath (const QString &path, const QString &filename_pattern) -> int64_t
 Get the File Size By Path object. More...
 
auto GetHumanFriendlyFileSize (int64_t size) -> QString
 Get the Human Readable File Size object. More...
 
void DeleteAllFilesByPattern (const QString &path, const QString &filename_pattern)
 
auto Trim (QString &s) -> QString
 
auto GetGpgmeErrorString (size_t buffer_size, gpgme_error_t err) -> QString
 
auto GetGpgmeErrorString (gpgme_error_t err) -> QString
 
auto CheckGpgError (GpgError err) -> GpgError
 
auto CheckGpgError2ErrCode (GpgError err, GpgError predict) -> GpgErrorCode
 
auto DescribeGpgErrCode (GpgError err) -> GpgErrorDesc
 
auto CheckGpgError (GpgError err, const QString &) -> GpgError
 
auto TextIsSigned (QString text) -> int
 
auto SetExtensionOfOutputFile (const QString &path, GpgOperation opera, bool ascii) -> QString
 
auto SetExtensionOfOutputFileForArchive (const QString &path, GpgOperation opera, bool ascii) -> QString
 
auto GPGFRONTEND_CORE_EXPORT TextIsSigned (BypeArrayRef text) -> int
 
auto GetFileChecksum (const QString &file_name, QCryptographicHash::Algorithm hashAlgorithm) -> QByteArray
 
auto ReadFile (const QString &file_name, QByteArray &data) -> bool
 read file content More...
 
auto WriteFile (const QString &file_name, const QByteArray &data) -> bool
 write file content More...
 
auto ReadFileGFBuffer (const QString &file_name) -> std::tuple< bool, GFBuffer >
 
auto WriteFileGFBuffer (const QString &file_name, GFBuffer data) -> bool
 
auto CalculateHash (const QString &file_path) -> QString
 
auto GetTempFilePath () -> QString
 
auto CreateTempFileAndWriteData (const QString &data) -> QString
 
auto CreateTempFileAndWriteData (const GFBuffer &data) -> QString
 
auto TargetFilePreCheck (const QString &path, bool read) -> std::tuple< bool, QString >
 
auto GetFullExtension (const QString &path) -> QString
 
auto GPGFRONTEND_CORE_EXPORT WriteBufferToFile (const QString &path, const QString &out_buffer) -> bool
 
auto GPGFRONTEND_CORE_EXPORT GetFullExtension (QString path) -> QString
 
auto GetFormatedDateByTimestamp (time_t timestamp) -> QString
 
auto GetDefaultLogger () -> std::shared_ptr< spdlog::logger >
 
auto GetCoreLogger () -> std::shared_ptr< spdlog::logger >
 
auto GetLogger (const QString &id) -> std::shared_ptr< spdlog::logger >
 
void SetDefaultLogLevel (spdlog::level::level_enum)
 Set the Default Log Level object. More...
 
void RegisterAsyncLogger (const QString &id, spdlog::level::level_enum level)
 
void RegisterSyncLogger (const QString &id, spdlog::level::level_enum level)
 
auto SecureMalloc (std::size_t size) -> void *
 
auto SecureRealloc (void *ptr, std::size_t size) -> void *
 
void SecureFree (void *)
 
template<typename T >
auto SecureMallocAsType (std::size_t size) -> T *
 
template<typename T >
auto SecureReallocAsType (T *ptr, std::size_t size) -> T *
 
template<typename T , typename... Args>
static auto SecureCreateObject (Args &&...args) -> T *
 
template<typename T >
static void SecureDestroyObject (T *obj)
 
template<typename T , typename... Args>
static auto SecureCreateUniqueObject (Args &&...args) -> std::unique_ptr< T, SecureObjectDeleter< T >>
 
template<typename T , typename... Args>
auto SecureCreateSharedObject (Args &&...args) -> std::shared_ptr< T >
 
template<typename T , typename... Args>
auto SecureCreateQSharedObject (Args &&...args) -> QSharedPointer< T >
 
void InitLoggingSystem (const GFCxtSPtr &ctx)
 
void InitGlobalPathEnv ()
 init global PATH env
 
void InitGlobalBasicalEnv (const GFCxtWPtr &p_ctx, bool gui_mode)
 
void InitLocale ()
 setup the locale and load the translations
 
void ShutdownGlobalBasicalEnv (const GFCxtWPtr &p_ctx)
 

Variables

constexpr int kCrashCode = ~0
 
SecureUniquePtr< SingletonStorageCollectionglobal_instance = nullptr
 
constexpr ssize_t kDataExchangerSize = 8192
 
constexpr int kRestartCode = 1000
 only refresh ui
 
constexpr int kDeepRestartCode = 1001
 
constexpr int kGpgFrontendDefaultChannel = 0
 
constexpr int kGpgFrontendNonAsciiChannel = 2
 
constexpr const char * PGP_CRYPT_BEGIN = "-----BEGIN PGP MESSAGE-----"
 
constexpr const char * PGP_CRYPT_END = "-----END PGP MESSAGE-----"
 
constexpr const char * PGP_SIGNED_BEGIN
 
constexpr const char * PGP_SIGNED_END = "-----END PGP SIGNATURE-----"
 
constexpr const char * PGP_SIGNATURE_BEGIN
 
constexpr const char * PGP_SIGNATURE_END = "-----END PGP SIGNATURE-----"
 
constexpr const char * PGP_PUBLIC_KEY_BEGIN
 
constexpr const char * PGP_PRIVATE_KEY_BEGIN
 
constexpr size_t kBufferSize = 32 * 1024
 

Detailed Description

Copyright (C) 2021 Saturneric eric@.nosp@m.bktu.nosp@m.s.com

This file is part of GpgFrontend.

GpgFrontend is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

GpgFrontend is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GpgFrontend. If not, see https://www.gnu.org/licenses/.

The initial version of the source code is inherited from the gpg4usb project, which is under GPL-3.0-or-later.

All the source code of GpgFrontend was modified and released by Saturneric eric@.nosp@m.bktu.nosp@m.s.com starting on May 12, 2021.

SPDX-License-Identifier: GPL-3.0-or-later

Function Documentation

◆ BeautifyFingerprint()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::BeautifyFingerprint ( QString  fingerprint) -> QString
Parameters
fingerprint
Returns
QString

Referenced by GpgFrontend::UI::VerifyKeyDetailBox::create_key_info_grid().

◆ CalculateHash()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::CalculateHash ( const QString &  file_path) -> QString

calculate the hash of a file

Parameters
file_path
Returns

References GetHumanFriendlyFileSize().

◆ CheckGpgError() [1/2]

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::CheckGpgError ( GpgError  err) -> GpgError
Parameters
err
Returns
GpgError

Referenced by GpgFrontend::GpgUIDOperator::AddUID(), GpgFrontend::GpgBasicOperator::Decrypt(), GpgFrontend::GpgFileOpera::DecryptArchive(), GpgFrontend::GpgFileOpera::DecryptFile(), GpgFrontend::GpgFileOpera::DecryptFileSync(), GpgFrontend::GpgBasicOperator::DecryptSync(), GpgFrontend::GpgBasicOperator::DecryptVerify(), GpgFrontend::GpgFileOpera::DecryptVerifyArchive(), GpgFrontend::GpgFileOpera::DecryptVerifyFile(), GpgFrontend::GpgFileOpera::DecryptVerifyFileSync(), GpgFrontend::GpgBasicOperator::DecryptVerifySync(), GpgFrontend::GpgKeyOpera::DeleteKeys(), GpgFrontend::GpgFileOpera::EncryptDerectorySymmetric(), GpgFrontend::GpgFileOpera::EncryptDerectorySymmetricSync(), GpgFrontend::GpgFileOpera::EncryptDirectory(), GpgFrontend::GpgFileOpera::EncryptFile(), GpgFrontend::GpgFileOpera::EncryptFileSymmetric(), GpgFrontend::GpgFileOpera::EncryptFileSymmetricSync(), GpgFrontend::GpgFileOpera::EncryptFileSync(), GpgFrontend::GpgBasicOperator::EncryptSign(), GpgFrontend::GpgFileOpera::EncryptSignDirectory(), GpgFrontend::GpgFileOpera::EncryptSignFile(), GpgFrontend::GpgFileOpera::EncryptSignFileSync(), GpgFrontend::GpgBasicOperator::EncryptSignSync(), GpgFrontend::GpgBasicOperator::EncryptSymmetric(), GpgFrontend::GpgBasicOperator::EncryptSymmetricSync(), GpgFrontend::GpgKeyOpera::GenerateKey(), GpgFrontend::KeyPackageOperator::GenerateKeyPackage(), GpgFrontend::GpgKeyOpera::GenerateKeySync(), GpgFrontend::GpgKeyOpera::GenerateKeyWithSubkey(), GpgFrontend::GpgKeyOpera::GenerateKeyWithSubkeySync(), GpgFrontend::GpgKeyOpera::GenerateSubkey(), GpgFrontend::GpgKeyOpera::GenerateSubkeySync(), GpgFrontend::GpgKeyImportExporter::ImportKey(), GpgFrontend::GpgKeyOpera::ModifyTOFUPolicy(), GpgFrontend::GpgKeyManager::RevSign(), GpgFrontend::GpgUIDOperator::RevUID(), GpgFrontend::GpgKeyManager::SetExpire(), GpgFrontend::GpgKeyManager::SetOwnerTrustLevel(), GpgFrontend::GpgUIDOperator::SetPrimaryUID(), GpgFrontend::GpgBasicOperator::SetSigners(), GpgFrontend::GpgBasicOperator::Sign(), GpgFrontend::GpgFileOpera::SignFile(), GpgFrontend::GpgFileOpera::SignFileSync(), GpgFrontend::GpgKeyManager::SignKey(), GpgFrontend::GpgBasicOperator::SignSync(), GpgFrontend::UI::MainWindow::slot_append_selected_keys(), GpgFrontend::UI::KeyPairOperaTab::slot_export_private_key(), GpgFrontend::UI::KeyGenDialog::slot_key_gen_accept(), GpgFrontend::UI::SubkeyGenerateDialog::slot_key_gen_accept(), GpgFrontend::UI::MainWindow::SlotArchiveDecrypt(), GpgFrontend::UI::MainWindow::SlotArchiveDecryptVerify(), GpgFrontend::UI::MainWindow::SlotDecrypt(), GpgFrontend::UI::MainWindow::SlotDecryptVerify(), GpgFrontend::UI::MainWindow::SlotDirectoryEncryptSign(), GpgFrontend::UI::MainWindow::SlotEncrypt(), GpgFrontend::UI::MainWindow::SlotEncryptSign(), GpgFrontend::UI::MainWindow::SlotFileDecrypt(), GpgFrontend::UI::MainWindow::SlotFileDecryptVerify(), GpgFrontend::UI::MainWindow::SlotFileEncrypt(), GpgFrontend::UI::MainWindow::SlotFileEncryptSign(), GpgFrontend::UI::MainWindow::SlotFileSign(), GpgFrontend::UI::MainWindow::SlotFileVerify(), GpgFrontend::UI::MainWindow::SlotSign(), GpgFrontend::UI::MainWindow::SlotVerify(), GpgFrontend::GpgBasicOperator::Verify(), GpgFrontend::GpgFileOpera::VerifyFile(), GpgFrontend::GpgFileOpera::VerifyFileSync(), and GpgFrontend::GpgBasicOperator::VerifySync().

◆ CheckGpgError() [2/2]

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::CheckGpgError ( GpgError  gpgmeError,
const QString &  comment 
) -> GpgError
Parameters
gpgmeError
comment
Returns
GpgError

◆ CheckGpgError2ErrCode()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::CheckGpgError2ErrCode ( gpgme_error_t  err,
gpgme_error_t  predict = GPG_ERR_NO_ERROR 
) -> gpg_err_code_t
Parameters
err
predict
Returns
gpg_err_code_t

Referenced by GpgFrontend::UI::CommonUtils::RaiseFailureMessageBox(), and GpgFrontend::UI::CommonUtils::RaiseMessageBox().

◆ CompareSoftwareVersion()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::CompareSoftwareVersion ( const QString &  a,
const QString &  b 
) -> int

◆ CreateTempFileAndWriteData() [1/2]

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::CreateTempFileAndWriteData ( const GFBuffer data) -> QString
Parameters
data
Returns
QString

References GetTempFilePath(), and WriteFile().

◆ CreateTempFileAndWriteData() [2/2]

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::CreateTempFileAndWriteData ( const QString &  data) -> QString
Parameters
data
Returns
QString

References GetTempFilePath(), and WriteFile().

◆ DeleteAllFilesByPattern()

void GPGFRONTEND_CORE_EXPORT GpgFrontend::DeleteAllFilesByPattern ( const QString &  path,
const QString &  filename_pattern 
)
Parameters
path
filename_pattern

◆ DescribeGpgErrCode()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::DescribeGpgErrCode ( GpgError  err) -> GpgErrorDesc

◆ GetCacheValue()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::GetCacheValue ( const QString &  key) -> QString

after get the temp cache, its value will be imediately ease in storage

Returns
QString

References GpgFrontend::SingletonFunctionObject< CacheManager >::GetInstance().

◆ GetChannelObjectInstance()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::GetChannelObjectInstance ( const std::type_info &  type,
int  channel 
) -> ChannelObject *

Get the Instance object.

Parameters
channel
Returns
T&

References GpgFrontend::SingletonStorageCollection::GetInstance().

Referenced by GpgFrontend::SingletonFunctionObject< T >::GetInstance().

◆ GetCoreLogger()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::GetCoreLogger ( ) -> std::shared_ptr< spdlog::logger >
Returns
std::shared_ptr<spdlog::logger>

References GpgFrontend::SingletonFunctionObject< LoggerManager >::GetInstance().

◆ GetDefaultLogger()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::GetDefaultLogger ( ) -> std::shared_ptr< spdlog::logger >
Returns
std::shared_ptr<spdlog::logger>

◆ GetFileExtension()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::GetFileExtension ( const QString &  path) -> QString

Get the file extension object.

Parameters
path
Returns
QString

◆ GetFileSizeByPath()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::GetFileSizeByPath ( const QString &  path,
const QString &  filename_pattern 
) -> int64_t

Get the File Size By Path object.

Parameters
pathThe path of the file
filename_patternThe pattern of the file name, e.g. "*.txt"
Returns
int64_t

◆ GetFullExtension()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::GetFullExtension ( QString  path) -> QString
Parameters
path
Returns
QString

◆ GetHumanFriendlyFileSize()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::GetHumanFriendlyFileSize ( int64_t  size) -> QString

Get the Human Readable File Size object.

Parameters
size
Returns
QString

Referenced by CalculateHash().

◆ GetLogger()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::GetLogger ( const QString &  ) -> std::shared_ptr< spdlog::logger >
Returns
std::shared_ptr<spdlog::logger>

References GpgFrontend::SingletonFunctionObject< LoggerManager >::GetInstance().

◆ GetOnlyFileNameWithPath()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::GetOnlyFileNameWithPath ( const QString &  path) -> QString

Get the only file name with path object.

Parameters
path
Returns
QString

◆ GetTempFilePath()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::GetTempFilePath ( ) -> QString
Returns
QString

Referenced by CreateTempFileAndWriteData().

◆ InitGlobalBasicalEnv()

void GpgFrontend::InitGlobalBasicalEnv ( const GFCxtWPtr &  ,
bool   
)

◆ InitLoggingSystem()

void GpgFrontend::InitLoggingSystem ( const GFCxtSPtr &  )
Parameters
args

References RegisterAsyncLogger(), and RegisterSyncLogger().

Referenced by InitGlobalBasicalEnv().

◆ ReadFile()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::ReadFile ( const QString &  file_name,
QByteArray &  data 
) -> bool

read file content

Parameters
file_namefile name
datadata read from file
Returns
true if success
false if failed

Referenced by GpgFrontend::DataObjectOperator::DataObjectOperator(), GpgFrontend::KeyPackageOperator::ImportKeyPackage(), ReadFileGFBuffer(), and GpgFrontend::UI::CommonUtils::SlotImportKeyFromFile().

◆ ReadFileGFBuffer()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::ReadFileGFBuffer ( const QString &  file_name) -> std::tuple< bool, GFBuffer >
Parameters
file_name
Returns
GFBuffer

References ReadFile().

◆ RegisterAsyncLogger()

void GPGFRONTEND_CORE_EXPORT GpgFrontend::RegisterAsyncLogger ( const QString &  ,
spdlog::level::level_enum   
)

◆ RegisterSyncLogger()

void GPGFRONTEND_CORE_EXPORT GpgFrontend::RegisterSyncLogger ( const QString &  ,
spdlog::level::level_enum   
)

◆ ResetCacheValue()

void GPGFRONTEND_CORE_EXPORT GpgFrontend::ResetCacheValue ( const QString &  )

imediately ease temp cache in storage

Returns
QString

References GpgFrontend::SingletonFunctionObject< CacheManager >::GetInstance().

◆ RunGpgOperaAsync()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::RunGpgOperaAsync ( const GpgOperaRunnable &  runnable,
const GpgOperationCallback &  callback,
const QString &  operation,
const QString &  minial_version 
) -> Thread::Task::TaskHandler

◆ RunGpgOperaSync()

◆ RunIOOperaAsync()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::RunIOOperaAsync ( const OperaRunnable &  runnable,
const OperationCallback &  callback,
const QString &  operation 
) -> Thread::Task::TaskHandler

◆ RunOperaAsync()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::RunOperaAsync ( const OperaRunnable &  runnable,
const OperationCallback &  callback,
const QString &  operation 
) -> Thread::Task::TaskHandler

◆ SecureMalloc()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::SecureMalloc ( std::size_t  ) -> void *
Returns
void*

◆ SecureMallocAsType()

template<typename T >
auto GpgFrontend::SecureMallocAsType ( std::size_t  size) -> T *
Template Parameters
T
Returns
T*

◆ SecureRealloc()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::SecureRealloc ( void *  ,
std::size_t   
) -> void *
Returns
void*

◆ SecureReallocAsType()

template<typename T >
auto GpgFrontend::SecureReallocAsType ( T *  ptr,
std::size_t  size 
) -> T *
Returns
void*

◆ SetDefaultLogLevel()

void GPGFRONTEND_CORE_EXPORT GpgFrontend::SetDefaultLogLevel ( spdlog::level::level_enum  )

Set the Default Log Level object.

Returns
auto

Referenced by InitGlobalBasicalEnv().

◆ SetExtensionOfOutputFile()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::SetExtensionOfOutputFile ( const QString &  path,
GpgOperation  opera,
bool  ascii 
) -> QString

◆ SetExtensionOfOutputFileForArchive()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::SetExtensionOfOutputFileForArchive ( const QString &  path,
GpgOperation  opera,
bool  ascii 
) -> QString

◆ ShutdownGlobalBasicalEnv()

◆ StartApplication()

auto GpgFrontend::StartApplication ( const GFCxtWPtr &  p_ctx) -> int
Parameters
argc
argv
Returns
int

internationalisation. loop to restart main window with changed translation when settings change.

References GpgFrontend::UI::InitGpgFrontendUI(), InitLocale(), kRestartCode, GpgFrontend::UI::RunGpgFrontendUI(), and GpgFrontend::Module::ShutdownGpgFrontendModules().

◆ TargetFilePreCheck()

◆ TextIsSigned()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::TextIsSigned ( BypeArrayRef  text) -> int
Parameters
text
Returns
int

◆ WriteBufferToFile()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::WriteBufferToFile ( const QString &  path,
const QString &  out_buffer 
) -> bool
Parameters
path
out_buffer
Returns
true
false

◆ WriteFile()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::WriteFile ( const QString &  file_name,
const QByteArray &  data 
) -> bool

write file content

Parameters
file_namefile name
datadata to write to file
Returns
true if success
false if failed

Referenced by CreateTempFileAndWriteData(), GpgFrontend::KeyPackageOperator::GenerateKeyPackage(), GpgFrontend::KeyPackageOperator::GeneratePassphrase(), GpgFrontend::DataObjectOperator::init_app_secure_key(), and WriteFileGFBuffer().

◆ WriteFileGFBuffer()

auto GPGFRONTEND_CORE_EXPORT GpgFrontend::WriteFileGFBuffer ( const QString &  file_name,
GFBuffer  data 
) -> bool
Parameters
file_name
data
Returns
true
false

References WriteFile().

Referenced by GpgFrontend::UI::KeyPairOperaTab::slot_export_private_key().

Variable Documentation

◆ PGP_PRIVATE_KEY_BEGIN

constexpr const char* GpgFrontend::PGP_PRIVATE_KEY_BEGIN
constexpr
Initial value:
=
"-----BEGIN PGP PRIVATE KEY BLOCK-----"

◆ PGP_PUBLIC_KEY_BEGIN

constexpr const char* GpgFrontend::PGP_PUBLIC_KEY_BEGIN
constexpr
Initial value:
=
"-----BEGIN PGP PUBLIC KEY BLOCK-----"

◆ PGP_SIGNATURE_BEGIN

constexpr const char* GpgFrontend::PGP_SIGNATURE_BEGIN
constexpr
Initial value:
=
"-----BEGIN PGP SIGNATURE-----"

◆ PGP_SIGNED_BEGIN

constexpr const char* GpgFrontend::PGP_SIGNED_BEGIN
constexpr
Initial value:
=
"-----BEGIN PGP SIGNED MESSAGE-----"