diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-05-14 00:20:11 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-18 23:25:46 +0200 |
commit | 8b94c3bf3a06caa7b003fe61e8242bdb00004eb5 (patch) | |
tree | c307bf3a9c1bf38ea23608b0700755fc76e6980e /src/Signature.cpp | |
parent | 0c8761b3d76912f034a0cb819d72f0349a25bf4f (diff) |
Replace files with sqlite
Using sqlite because sqlite has transactions, storing/loading from files
automatically, unloading data that is not accessed often.
Removed cosmetic data (node name, username). They can be added using
addData by the application that uses odhtdb instead.
Database callback functions can now be called with stored data using
database.loadNode function.
TODO: Add local user storage (with password) back, it has been temorary
disabled
Diffstat (limited to 'src/Signature.cpp')
-rw-r--r-- | src/Signature.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Signature.cpp b/src/Signature.cpp index c64af01..ba3ebde 100644 --- a/src/Signature.cpp +++ b/src/Signature.cpp @@ -12,6 +12,11 @@ namespace odhtdb { const PublicKey PublicKey::ZERO("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", PUBLIC_KEY_NUM_BYTES); + PublicKey::PublicKey() + { + memset(data, 0, PUBLIC_KEY_NUM_BYTES); + } + PublicKey::PublicKey(const char *_data, size_t size) { if(size != PUBLIC_KEY_NUM_BYTES) @@ -71,6 +76,11 @@ namespace odhtdb const PrivateKey PrivateKey::ZERO("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", PRIVATE_KEY_NUM_BYTES); + PrivateKey::PrivateKey() + { + memset(data, 0, PRIVATE_KEY_NUM_BYTES); + } + PrivateKey::PrivateKey(const char *_data, size_t size) { if(size != PRIVATE_KEY_NUM_BYTES) |