Electroneum
epee::crypted_storage< t_base_storage, crypt_provider, t_key_provider > Class Template Reference

#include <crypted_storage.h>

Inheritance diagram for epee::crypted_storage< t_base_storage, crypt_provider, t_key_provider >:
Collaboration diagram for epee::crypted_storage< t_base_storage, crypt_provider, t_key_provider >:

Public Member Functions

size_t PackToSolidBuffer (std::string &targetObj)
 
size_t LoadFromSolidBuffer (const std::string &pTargetObj)
 

Detailed Description

template<class t_base_storage, class crypt_provider, class t_key_provider>
class epee::crypted_storage< t_base_storage, crypt_provider, t_key_provider >

Definition at line 36 of file crypted_storage.h.

Member Function Documentation

◆ LoadFromSolidBuffer()

template<class t_base_storage , class crypt_provider , class t_key_provider >
size_t epee::crypted_storage< t_base_storage, crypt_provider, t_key_provider >::LoadFromSolidBuffer ( const std::string &  pTargetObj)
inline

Definition at line 51 of file crypted_storage.h.

52  {
53  std::string buff_to_decrypt = pTargetObj;
54  if(crypt_provider::decrypt(buff_to_decrypt, t_key_provider::get_storage_default_key()))
55  return t_base_storage::LoadFromSolidBuffer(buff_to_decrypt);
56 
57  return 0;
58  }
::std::string string
Definition: gtest-port.h:1097
void decrypt(const void *ciphertext, size_t length, const uint8_t *key, const uint8_t *iv, char *plaintext, size_t *plaintext_len)
Definition: protocol.cpp:120
Here is the call graph for this function:

◆ PackToSolidBuffer()

template<class t_base_storage , class crypt_provider , class t_key_provider >
size_t epee::crypted_storage< t_base_storage, crypt_provider, t_key_provider >::PackToSolidBuffer ( std::string &  targetObj)
inline

Definition at line 39 of file crypted_storage.h.

40  {
41  size_t res = t_base_storage::PackToSolidBuffer(targetObj);
42  if(res <= 0)
43  return res;
44 
45  if(!crypt_provider::encrypt(targetObj, t_key_provider::get_storage_default_key()))
46  return 0;
47 
48  return targetObj.size();
49  }
const char * res
Definition: hmac_keccak.cpp:41

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