CppCMS
|
Key object, holds the string that represents the binary key. More...
#include <cppcms/crypto.h>
Public Member Functions | |
key () | |
key (key const &other) | |
key const & | operator= (key const &) |
~key () | |
key (void const *data, size_t length) | |
key (char const *s) | |
key (std::string const &) | |
char const * | data () const |
size_t | size () const |
void | reset () |
void | set (void const *ptr, size_t len) |
void | set_hex (char const *ptr, size_t len) |
void | read_from_file (std::string const &file_name) |
Key object, holds the string that represents the binary key.
When the key is destroyed it zeros all the memory it uses to prevent accidental leaks of the highly confidential data
cppcms::crypto::key::key | ( | ) |
Create an empty key on 0 length
cppcms::crypto::key::key | ( | key const & | other | ) |
Copy the key
cppcms::crypto::key::~key | ( | ) |
Destroy they key object clearing the area used by it.
cppcms::crypto::key::key | ( | void const * | data, |
size_t | length | ||
) |
Create a key using binary representation pointed by data of length bytes
|
explicit |
Create a key using the hexadecimal representation
|
explicit |
Create a key using the hexadecimal representation
char const* cppcms::crypto::key::data | ( | ) | const |
Get the pointer to data, never returns NULL even if size() == 0
void cppcms::crypto::key::read_from_file | ( | std::string const & | file_name | ) |
Read the key from file. Under windows file_name should be UTF-8 encoded string.
void cppcms::crypto::key::reset | ( | ) |
Clear the key - and clear the area it was stored it
void cppcms::crypto::key::set | ( | void const * | ptr, |
size_t | len | ||
) |
Set the binary value for the key
void cppcms::crypto::key::set_hex | ( | char const * | ptr, |
size_t | len | ||
) |
Set the value for the key using hexadecimal representation
size_t cppcms::crypto::key::size | ( | ) | const |
Get the size of the key