Disk ARchive  2.7.15
Full featured and portable backup and archiving tool
Public Member Functions | Private Member Functions | Private Attributes | List of all members
libdar::crypto_asym Class Reference

asymetric ciphering More...

#include <crypto_asym.hpp>

+ Inheritance diagram for libdar::crypto_asym:
+ Collaboration diagram for libdar::crypto_asym:

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_asymoperator= (const crypto_asym &ref)=delete
 disabling object assignment
 
crypto_asymoperator= (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 More...
 
void decrypt (generic_file &ciphered, generic_file &clear)
 un-cipher data More...
 
const std::list< signator > & verify () const
 
user_interactionget_ui () const
 exposing to public visibility the protected method of mem_ui More...
 
- Public Member Functions inherited from libdar::mem_ui
 mem_ui (const std::shared_ptr< user_interaction > &dialog)
 constructor More...
 
 mem_ui (const mem_ui &ref)=default
 the copy constructor More...
 
 mem_ui (mem_ui &&ref) noexcept=default
 the move constructor
 
mem_uioperator= (const mem_ui &ref)=default
 assignement operator More...
 
mem_uioperator= (mem_ui &&ref) noexcept=default
 move operator
 
virtual ~mem_ui () noexcept(false)
 destructor More...
 

Private Member Functions

void release_context ()
 
void build_context ()
 

Private Attributes

bool has_signatories
 
std::list< signatorsigning_result
 

Additional Inherited Members

- Protected Member Functions inherited from libdar::mem_ui
user_interactionget_ui () const
 get access to the user_interaction object More...
 
std::shared_ptr< user_interactionget_pointer () const
 get access to the shared_ptr pointing to the user_interaction
 

Detailed Description

asymetric ciphering

Definition at line 50 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]cipheredcontains the encrypted data to decipher
[out]clearresulting 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_emaillist of email or keyid of recipient that will be able to read the encrypted data
[in]clearwhere to read from clear data to be encrypted (the object must be readable)
[out]cipheredwhere 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().

◆ 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.


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