![]() |
Disk ARchive 2.7.14
Full featured and portable backup and archiving tool
|
class secu_string More...
#include <secu_string.hpp>
Public Member Functions | |
secu_string (U_I storage_size=0) | |
constructor 1 | |
secu_string (const char *ptr, U_I size) | |
constructor 2 | |
secu_string (const secu_string &ref) | |
the copy constructor | |
secu_string (secu_string &&ref) noexcept | |
the move constructor | |
secu_string & | operator= (const secu_string &ref) |
the assignment operator | |
secu_string & | operator= (secu_string &&ref) noexcept |
the move operator | |
~secu_string () noexcept | |
the destructor (set memory to zero before releasing it) | |
bool | operator!= (const std::string &ref) const |
bool | operator!= (const secu_string &ref) const |
bool | operator== (const std::string &ref) const |
bool | operator== (const secu_string &ref) const |
void | set (int fd, U_I size) |
fill the object with data | |
void | append_at (U_I offset, const char *ptr, U_I size) |
append some data to the string at a given offset | |
void | append_at (U_I offset, int fd, U_I size) |
append some data to the string | |
void | append (const char *ptr, U_I size) |
append some data at the end of the string | |
void | append (int fd, U_I size) |
append some data at the end of the string | |
void | reduce_string_size_to (U_I pos) |
void | expand_string_size_to (U_I size) |
set the string size within the allocated secure memory | |
void | clear () |
clear the string (set to an empty string) | |
void | resize (U_I size) |
clear and resize the string to the defined allocated size | |
void | randomize (U_I size) |
set the string to randomize string of given size | |
const char * | c_str () const |
get access to the secure string | |
char * | c_str () |
void | set_size (U_I size) |
char * | get_array () |
non constant flavor of direct secure memory access | |
char & | operator[] (U_I index) |
get access to the secure string by index | |
char | operator[] (U_I index) const |
U_I | get_size () const |
get the size of the string | |
bool | empty () const |
tell whether string is empty | |
U_I | get_allocated_size () const |
get the size of the allocated secure space | |
secu_string (U_I storage_size=0) | |
constructor 1 | |
secu_string (const char *ptr, U_I size) | |
constructor 2 | |
secu_string (const secu_string &ref) | |
the copy constructor | |
secu_string (secu_string &&ref) noexcept | |
the move constructor | |
secu_string & | operator= (const secu_string &ref) |
the assignment operator | |
secu_string & | operator= (secu_string &&ref) noexcept |
the move operator | |
~secu_string () noexcept | |
the destructor (set memory to zero before releasing it) | |
bool | operator!= (const std::string &ref) const |
bool | operator!= (const secu_string &ref) const |
bool | operator== (const std::string &ref) const |
bool | operator== (const secu_string &ref) const |
void | set (int fd, U_I size) |
fill the object with data | |
void | append_at (U_I offset, const char *ptr, U_I size) |
append some data to the string at a given offset | |
void | append_at (U_I offset, int fd, U_I size) |
append some data to the string | |
void | append (const char *ptr, U_I size) |
append some data at the end of the string | |
void | append (int fd, U_I size) |
append some data at the end of the string | |
void | reduce_string_size_to (U_I pos) |
void | expand_string_size_to (U_I size) |
set the string size within the allocated secure memory | |
void | clear () |
clear the string (set to an empty string) | |
void | resize (U_I size) |
clear and resize the string to the defined allocated size | |
void | randomize (U_I size) |
set the string to randomize string of given size | |
const char * | c_str () const |
get access to the secure string | |
char * | c_str () |
void | set_size (U_I size) |
char * | get_array () |
non constant flavor of direct secure memory access | |
char & | operator[] (U_I index) |
get access to the secure string by index | |
char | operator[] (U_I index) const |
U_I | get_size () const |
get the size of the string | |
bool | empty () const |
tell whether string is empty | |
U_I | get_allocated_size () const |
get the size of the allocated secure space | |
Static Public Member Functions | |
static bool | is_string_secured () |
to know if secure memory is available | |
static bool | is_string_secured () |
to know if secure memory is available | |
Private Member Functions | |
void | nullifyptr () noexcept |
void | init (U_I size) |
void | copy_from (const secu_string &ref) |
void | move_from (secu_string &&ref) noexcept |
bool | compare_with (const char *ptr, U_I size) const |
void | clean_and_destroy () |
void | nullifyptr () noexcept |
void | init (U_I size) |
void | copy_from (const secu_string &ref) |
void | move_from (secu_string &&ref) noexcept |
bool | compare_with (const char *ptr, U_I size) const |
void | clean_and_destroy () |
Private Attributes | |
U_I * | allocated_size |
char * | mem |
U_I * | string_size |
class secu_string
it manages the allocation/release of a given size block of memory the memory block is forbidden to be swapped (if is_strin_secured() is true) and is zeroed before being released
Definition at line 53 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inline |
constructor 1
create the allocated string in secure memory
[in] | storage_size | is the amount of secured memory to obtain when creating the object |
Definition at line 68 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
constructor 2
create the string from a pointer to a (secure) string or from a portion of it
Definition at line 73 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
References append_at().
|
inline |
the copy constructor
Definition at line 76 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inlinenoexcept |
the move constructor
Definition at line 79 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inlinenoexcept |
the destructor (set memory to zero before releasing it)
Definition at line 88 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inline |
constructor 1
create the allocated string in secure memory
[in] | storage_size | is the amount of secured memory to obtain when creating the object |
Definition at line 68 of file src/libdar/secu_string.hpp.
constructor 2
create the string from a pointer to a (secure) string or from a portion of it
Definition at line 73 of file src/libdar/secu_string.hpp.
References append_at().
|
inline |
the copy constructor
Definition at line 76 of file src/libdar/secu_string.hpp.
|
inlinenoexcept |
the move constructor
Definition at line 79 of file src/libdar/secu_string.hpp.
|
inlinenoexcept |
the destructor (set memory to zero before releasing it)
Definition at line 88 of file src/libdar/secu_string.hpp.
append some data at the end of the string
Definition at line 121 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
References append_at().
append some data at the end of the string
Definition at line 121 of file src/libdar/secu_string.hpp.
References append_at().
append some data at the end of the string
Definition at line 124 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
References append_at().
append some data at the end of the string
Definition at line 124 of file src/libdar/secu_string.hpp.
References append_at().
append some data to the string at a given offset
[in] | offset | defines at which offset in the secu_string will be placed the string to append |
[in] | ptr | is the address of the string to append |
[in] | size | is the number of byte to append |
Referenced by append(), append(), and secu_string().
append some data to the string at a given offset
[in] | offset | defines at which offset in the secu_string will be placed the string to append |
[in] | ptr | is the address of the string to append |
[in] | size | is the number of byte to append |
|
inline |
Definition at line 153 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inline |
Definition at line 153 of file src/libdar/secu_string.hpp.
get access to the secure string
Definition at line 152 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
get access to the secure string
Definition at line 152 of file src/libdar/secu_string.hpp.
|
inline |
clear the string (set to an empty string)
Definition at line 136 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inline |
clear the string (set to an empty string)
Definition at line 136 of file src/libdar/secu_string.hpp.
|
inline |
tell whether string is empty
Definition at line 169 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inline |
tell whether string is empty
Definition at line 169 of file src/libdar/secu_string.hpp.
|
inline |
get the size of the allocated secure space
Definition at line 172 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inline |
get the size of the allocated secure space
Definition at line 172 of file src/libdar/secu_string.hpp.
|
inline |
non constant flavor of direct secure memory access
Definition at line 157 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inline |
non constant flavor of direct secure memory access
Definition at line 157 of file src/libdar/secu_string.hpp.
|
inline |
get the size of the string
Definition at line 166 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inline |
get the size of the string
Definition at line 166 of file src/libdar/secu_string.hpp.
to know if secure memory is available
it is advised that the user program of class secu_string uses this call before using objects of that class and if returned false, advise the user that the necessary support for secure memory is not present, that any sensitive data may be swapped out under heavy memory load and thus may lead secure password to be wrote to disk in clear.
to know if secure memory is available
it is advised that the user program of class secu_string uses this call before using objects of that class and if returned false, advise the user that the necessary support for secure memory is not present, that any sensitive data may be swapped out under heavy memory load and thus may lead secure password to be wrote to disk in clear.
|
inlineprivatenoexcept |
Definition at line 182 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inlineprivatenoexcept |
Definition at line 182 of file src/libdar/secu_string.hpp.
|
inlineprivatenoexcept |
Definition at line 179 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inlineprivatenoexcept |
Definition at line 179 of file src/libdar/secu_string.hpp.
|
inline |
Definition at line 92 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inline |
Definition at line 92 of file src/libdar/secu_string.hpp.
Definition at line 91 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
Definition at line 91 of file src/libdar/secu_string.hpp.
|
inline |
the assignment operator
Definition at line 82 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inline |
the assignment operator
Definition at line 82 of file src/libdar/secu_string.hpp.
|
inlinenoexcept |
the move operator
Definition at line 85 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inlinenoexcept |
the move operator
Definition at line 85 of file src/libdar/secu_string.hpp.
|
inline |
Definition at line 94 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inline |
Definition at line 94 of file src/libdar/secu_string.hpp.
Definition at line 93 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
Definition at line 93 of file src/libdar/secu_string.hpp.
char & libdar::secu_string::operator[] | ( | U_I | index | ) |
get access to the secure string by index
char & libdar::secu_string::operator[] | ( | U_I | index | ) |
get access to the secure string by index
|
inline |
Definition at line 163 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inline |
Definition at line 163 of file src/libdar/secu_string.hpp.
void libdar::secu_string::randomize | ( | U_I | size | ) |
set the string to randomize string of given size
void libdar::secu_string::randomize | ( | U_I | size | ) |
set the string to randomize string of given size
void libdar::secu_string::reduce_string_size_to | ( | U_I | pos | ) |
shorten the string (do not change the allocated size)
[in] | pos | is the length of the string to set, it must be smaller or equal to the current size |
void libdar::secu_string::reduce_string_size_to | ( | U_I | pos | ) |
shorten the string (do not change the allocated size)
[in] | pos | is the length of the string to set, it must be smaller or equal to the current size |
|
inline |
clear and resize the string to the defined allocated size
[in] | size | is the amount of secure memory to allocated |
Definition at line 141 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
inline |
clear and resize the string to the defined allocated size
[in] | size | is the amount of secure memory to allocated |
Definition at line 141 of file src/libdar/secu_string.hpp.
fill the object with data
set at most size bytes of data directly from the filedescriptor,
[in] | fd | the filedescriptor to read data from |
[in] | size | is the maximum number of byte read |
fill the object with data
set at most size bytes of data directly from the filedescriptor,
[in] | fd | the filedescriptor to read data from |
[in] | size | is the maximum number of byte read |
|
private |
Definition at line 175 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
private |
Definition at line 176 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.
|
private |
Definition at line 177 of file dar64-2.7.14-win64/include/dar/secu_string.hpp.