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

Public Member Functions | Static Public Member Functions | List of all members
GpgFrontend::GpgFileOpera Class Reference
Inheritance diagram for GpgFrontend::GpgFileOpera:
Collaboration diagram for GpgFrontend::GpgFileOpera:

## Public Member Functions
| GpgFileOpera (int channel=SingletonFunctionObject::GetDefaultChannel())
Public Member Functions inherited from GpgFrontend::SingletonFunctionObject< GpgFileOpera >
| SingletonFunctionObject (const SingletonFunctionObject< GpgFileOpera > &)=delete
| prohibit copy
| SingletonFunctionObject (GpgFileOpera &&)=delete
| Construct a new Singleton Function Object object.
| SingletonFunctionObject (const GpgFileOpera &)=delete
| Construct a new Singleton Function Object object.
SingletonFunctionObject & | operator= (const SingletonFunctionObject< GpgFileOpera > &)=delete
| prohibit copy More...
void | operator= (const GpgFileOpera &)=delete
int | GetChannel () const
| Get the Channel object. More...
Public Member Functions inherited from GpgFrontend::ChannelObject
| ChannelObject () noexcept
| Construct a new Default Channel Object object.
| ChannelObject (int channel)
| Construct a new Channel Object object. More...
int | GetChannel () const
| Get the Channel object. More...
void | SetChannel (int channel)
| Set the Channel object. More...

## Static Public Member Functions
static unsigned int | EncryptFile (KeyListPtr keys, const std::string &in_path, const std::string &out_path, GpgEncrResult &result, int _channel=GPGFRONTEND_DEFAULT_CHANNEL)
| Encrypted file. More...
static unsigned int | EncryptFileSymmetric (const std::string &in_path, const std::string &out_path, GpgEncrResult &result, int _channel=GPGFRONTEND_DEFAULT_CHANNEL)
| 运用对称加密算法加密文件 More...
static GpgError | DecryptFile (const std::string &in_path, const std::string &out_path, GpgDecrResult &result)
static GpgError | SignFile (KeyListPtr keys, const std::string &in_path, const std::string &out_path, GpgSignResult &result, int _channel=GPGFRONTEND_DEFAULT_CHANNEL)
static GpgError | VerifyFile (const std::string &data_path, const std::string &sign_path, GpgVerifyResult &result, int _channel=GPGFRONTEND_DEFAULT_CHANNEL)
static GpgError | EncryptSignFile (KeyListPtr keys, KeyListPtr signer_keys, const std::string &in_path, const std::string &out_path, GpgEncrResult &encr_res, GpgSignResult &sign_res, int _channel=GPGFRONTEND_DEFAULT_CHANNEL)
static GpgError | DecryptVerifyFile (const std::string &in_path, const std::string &out_path, GpgDecrResult &decr_res, GpgVerifyResult &verify_res)
Static Public Member Functions inherited from GpgFrontend::SingletonFunctionObject< GpgFileOpera >
static GpgFileOpera & | GetInstance (int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
| Get the Instance object. More...
static GpgFileOpera & | CreateInstance (int channel, std::function< std::unique_ptr< ChannelObject >(void)> factory)
| Create a Instance object. More...
static void | ReleaseChannel (int channel)
static int | GetDefaultChannel ()
| Get the Default Channel object. More...
static std::vector< int > | GetAllChannelId ()
| Get all the channel ids. More...
Static Public Member Functions inherited from GpgFrontend::ChannelObject
static int | GetDefaultChannel ()
| Get the Default Channel object. More...

## Additional Inherited Members
Protected Member Functions inherited from GpgFrontend::SingletonFunctionObject< GpgFileOpera >
| 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

## ◆ GpgFileOpera()

GpgFrontend::GpgFileOpera::GpgFileOpera | ( | int | channel = `SingletonFunctionObject::GetDefaultChannel()` | ) |
| explicit

Copyright (C) 2021 Saturneric

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 Saturnericeric@.nosp@m.bktu.nosp@m.s.com starting on May 12, 2021.

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

## Member Function Documentation

## ◆ DecryptFile()

GpgFrontend::GpgError GpgFrontend::GpgFileOpera::DecryptFile | ( | const std::string & | in_path,
|  | const std::string & | out_path,
|  | GpgDecrResult & | result
| ) |  |
| static

Parameters

  in_path |
  out_path |
  result |

Returns
  GpgError

References GpgFrontend::check_gpg_error_2_err_code(), GpgFrontend::GpgBasicOperator::Decrypt(), GpgFrontend::SingletonFunctionObject< GpgBasicOperator >::GetInstance(), GpgFrontend::FileOperator::ReadFileStd(), and GpgFrontend::FileOperator::WriteFileStd().

Referenced by GpgFrontend::UI::MainWindow::SlotFileDecrypt().

## ◆ DecryptVerifyFile()

gpg_error_t GpgFrontend::GpgFileOpera::DecryptVerifyFile | ( | const std::string & | in_path,
|  | const std::string & | out_path,
|  | GpgDecrResult & | decr_res,
|  | GpgVerifyResult & | verify_res
| ) |  |
| static

Parameters

  in_path |
  out_path |
  decr_res |
  verify_res |

Returns
  GpgError

References GpgFrontend::check_gpg_error_2_err_code(), GpgFrontend::GpgBasicOperator::DecryptVerify(), GpgFrontend::SingletonFunctionObject< GpgBasicOperator >::GetInstance(), GpgFrontend::FileOperator::ReadFileStd(), and GpgFrontend::FileOperator::WriteFileStd().

Referenced by GpgFrontend::UI::MainWindow::SlotFileDecryptVerify().

## ◆ EncryptFile()

GpgFrontend::GpgError GpgFrontend::GpgFileOpera::EncryptFile | ( | KeyListPtr | keys,
|  | const std::string & | in_path,
|  | const std::string & | out_path,
|  | GpgEncrResult & | result,
|  | int | _channel = `GPGFRONTEND_DEFAULT_CHANNEL`
| ) |  |
| static

Encrypted file.

Parameters

  keys | Used public key
  in_path | The path where the enter file is located
  out_path | The path where the output file is located
  result | Encrypted results
  _channel | Channel in context

Returns
  unsigned int error code

References GpgFrontend::check_gpg_error_2_err_code(), GpgFrontend::GpgBasicOperator::Encrypt(), GpgFrontend::SingletonFunctionObject< GpgBasicOperator >::GetInstance(), GpgFrontend::FileOperator::ReadFileStd(), and GpgFrontend::FileOperator::WriteFileStd().

Referenced by GpgFrontend::UI::MainWindow::SlotFileEncrypt().

## ◆ EncryptFileSymmetric()

unsigned int GpgFrontend::GpgFileOpera::EncryptFileSymmetric | ( | const std::string & | in_path,
|  | const std::string & | out_path,
|  | GpgFrontend::GpgEncrResult & | result,
|  | int | _channel = `GPGFRONTEND_DEFAULT_CHANNEL`
| ) |  |
| static

运用对称加密算法加密文件

Parameters

  in_path |
  out_path |
  result |
  _channel |

Returns
  unsigned int

References GpgFrontend::check_gpg_error_2_err_code(), GpgFrontend::GpgBasicOperator::EncryptSymmetric(), GpgFrontend::SingletonFunctionObject< GpgBasicOperator >::GetInstance(), GpgFrontend::FileOperator::ReadFileStd(), and GpgFrontend::FileOperator::WriteFileStd().

Referenced by GpgFrontend::UI::MainWindow::SlotFileEncrypt().

## ◆ EncryptSignFile()

gpg_error_t GpgFrontend::GpgFileOpera::EncryptSignFile | ( | KeyListPtr | keys,
|  | KeyListPtr | signer_keys,
|  | const std::string & | in_path,
|  | const std::string & | out_path,
|  | GpgEncrResult & | encr_res,
|  | GpgSignResult & | sign_res,
|  | int | _channel = `GPGFRONTEND_DEFAULT_CHANNEL`
| ) |  |
| static

Parameters

  keys |
  signer_keys |
  in_path |
  out_path |
  encr_res |
  sign_res |
  _channel |

Returns
  GpgError

References GpgFrontend::check_gpg_error_2_err_code(), GpgFrontend::GpgBasicOperator::EncryptSign(), GpgFrontend::SingletonFunctionObject< GpgBasicOperator >::GetInstance(), GpgFrontend::FileOperator::ReadFileStd(), and GpgFrontend::FileOperator::WriteFileStd().

Referenced by GpgFrontend::UI::MainWindow::SlotFileEncryptSign().

## ◆ SignFile()

gpgme_error_t GpgFrontend::GpgFileOpera::SignFile | ( | KeyListPtr | keys,
|  | const std::string & | in_path,
|  | const std::string & | out_path,
|  | GpgSignResult & | result,
|  | int | _channel = `GPGFRONTEND_DEFAULT_CHANNEL`
| ) |  |
| static

Parameters

  keys |
  in_path |
  out_path |
  result |
  _channel |

Returns
  GpgError

References GpgFrontend::check_gpg_error_2_err_code(), GpgFrontend::SingletonFunctionObject< GpgBasicOperator >::GetInstance(), GpgFrontend::FileOperator::ReadFileStd(), GpgFrontend::GpgBasicOperator::Sign(), and GpgFrontend::FileOperator::WriteFileStd().

Referenced by GpgFrontend::UI::MainWindow::SlotFileSign().

## ◆ VerifyFile()

gpgme_error_t GpgFrontend::GpgFileOpera::VerifyFile | ( | const std::string & | data_path,
|  | const std::string & | sign_path,
|  | GpgVerifyResult & | result,
|  | int | _channel = `GPGFRONTEND_DEFAULT_CHANNEL`
| ) |  |
| static

Parameters

  data_path |
  sign_path |
  result |
  _channel |

Returns
  GpgError

References GpgFrontend::SingletonFunctionObject< GpgBasicOperator >::GetInstance(), GpgFrontend::FileOperator::ReadFileStd(), and GpgFrontend::GpgBasicOperator::Verify().

Referenced by GpgFrontend::UI::MainWindow::SlotFileVerify().

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

- src/core/function/gpg/GpgFileOpera.h
- src/core/function/gpg/GpgFileOpera.cpp