| Disk ARchive 2.8.4 Full featured and portable backup and archiving tool

Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
libdar::crypto_asym Class Reference
Private

asymetric ciphering More...

`#include <crypto_asym.hpp>`

Inherits libdar::mem_ui.

## Public Member Functions
| crypto_asym (const std::shared_ptr< user_interaction > &ui)
| general use constructor
| crypto_asym (const crypto_asym &ref)=delete
| disabling copy constructor
| crypto_asym (crypto_asym &&ref)=delete
| disabling move constuctor
crypto_asym & | operator= (const crypto_asym &ref)=delete
| disabling object assignment
crypto_asym & | operator= (crypto_asym &&ref)=delete
| disabling move assignment operator
| ~crypto_asym ()
| the destructor
void | set_signatories (const std::vector< std::string > &signatories)
| defines the list of email or keyid which associated key will be used for signing
void | encrypt (const std::vector< std::string > &recipients_email, generic_file &clear, generic_file &ciphered)
| encrypt (and sign if signatures have been given using set_signatories) data for the given recipients
void | decrypt (generic_file &ciphered, generic_file &clear)
| un-cipher data
const std::list< signator > & | verify () const
user_interaction & | get_ui () const
| exposing to public visibility the protected method of mem_ui
Public Member Functions inherited from libdar::mem_ui
| mem_ui (const std::shared_ptr< user_interaction > &dialog)
| constructor
| mem_ui (const mem_ui &ref)=default
| the copy constructor
| mem_ui (mem_ui &&ref) noexcept=default
| the move constructor
mem_ui & | operator= (const mem_ui &ref)=default
| assignement operator
mem_ui & | operator= (mem_ui &&ref) noexcept=default
| move operator
virtual | ~mem_ui () noexcept(false)
| destructor

## Private Member Functions
void | release_context ()
void | build_context ()

## Private Attributes
bool | has_signatories
std::list< signator > | signing_result

## Additional Inherited Members
Protected Member Functions inherited from libdar::mem_ui
user_interaction & | get_ui () const
| get access to the user_interaction object
std::shared_ptr< user_interaction > | get_pointer () const
| get access to the shared_ptr pointing to the user_interaction
void | change_ui (const std::shared_ptr< user_interaction > &new_dialog)
| change the user_interaction object

## Detailed Description

asymetric ciphering

Definition at line 50 of file crypto_asym.hpp.

## Constructor & Destructor Documentation

## ◆ crypto_asym()

libdar::crypto_asym::crypto_asym | ( | const std::shared_ptr< user_interaction > & | ui | ) |
| inline

general use constructor

Definition at line 55 of file crypto_asym.hpp.

References libdar::mem_ui::mem_ui().

Referenced by crypto_asym(), crypto_asym(), operator=(), and operator=().

## ◆ ~crypto_asym()

libdar::crypto_asym::~crypto_asym | ( |  | ) |
| inline

the destructor

Definition at line 70 of file crypto_asym.hpp.

## Member Function Documentation

## ◆ decrypt()

void libdar::crypto_asym::decrypt | ( | generic_file & | ciphered,
|  | generic_file & | clear )

un-cipher data

Parameters

  [in] | ciphered | contains the encrypted data to decipher
  [out] | clear | resulting un-ciphered (thus clear) data (the object must be readable)

Note
  this assumes the GnuPG keyring has an appropriated private key (the objet must be writable)

## ◆ encrypt()

void libdar::crypto_asym::encrypt | ( | const std::vector< std::string > & | recipients_email,
|  | generic_file & | clear,
|  | generic_file & | ciphered )

encrypt (and sign if signatures have been given using set_signatories) data for the given recipients

Parameters

  [in] | recipients_email | list of email or keyid of recipient that will be able to read the encrypted data
  [in] | clear | where to read from clear data to be encrypted (the object must be readable)
  [out] | ciphered | where to write down encrypted data (the object must be writable)

Note
  this assumes the GnuPG keyring has the public keys of the recipient listed

## ◆ get_ui()

user_interaction & libdar::crypto_asym::get_ui | ( |  | ) | const
| inline

exposing to public visibility the protected method of mem_ui

used to provide access to the user_interaction from the callback function required by gpgme_set_passphrase_cb().

Definition at line 99 of file crypto_asym.hpp.

References libdar::mem_ui::get_ui().

## ◆ release_context()

void libdar::crypto_asym::release_context | ( |  | ) |
| inline private

Definition at line 115 of file crypto_asym.hpp.

## ◆ verify()

const std::list< signator > & libdar::crypto_asym::verify | ( |  | ) | const
| inline

after un-ciphering data retrieve the list of signature that were used beside encryption return a sorted list of signatories

Definition at line 93 of file crypto_asym.hpp.

## Member Data Documentation

## ◆ has_signatories

bool libdar::crypto_asym::has_signatories
| private

Definition at line 102 of file crypto_asym.hpp.

## ◆ signing_result

std::list<signator> libdar::crypto_asym::signing_result
| private

Definition at line 103 of file crypto_asym.hpp.

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

- crypto_asym.hpp