diff options
author | dec05eba <0xdec05eba@gmail.com> | 2018-05-14 03:07:43 +0200 |
---|---|---|
committer | dec05eba <0xdec05eba@gmail.com> | 2018-05-14 03:07:46 +0200 |
commit | 1fe14e8fcfbec25cb6b70df194a82ede4cc0a3e5 (patch) | |
tree | 06e5fee96df9f9205e729bb2a3a9976f7de15ab1 /include/odhtdb/LocalUserEncrypted.hpp | |
parent | 87a425d8461b084407cfe5aa11ca2832033b4453 (diff) |
Remove user/group classes, user public key/group id directly to database instead
Diffstat (limited to 'include/odhtdb/LocalUserEncrypted.hpp')
-rw-r--r-- | include/odhtdb/LocalUserEncrypted.hpp | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/include/odhtdb/LocalUserEncrypted.hpp b/include/odhtdb/LocalUserEncrypted.hpp deleted file mode 100644 index 7919cb3..0000000 --- a/include/odhtdb/LocalUserEncrypted.hpp +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -#include "types.hpp" -#include "Encryption.hpp" -#include "Signature.hpp" - -namespace odhtdb -{ - struct EncryptedPrivateKey - { - u8 nonce[ENCRYPTION_NONCE_BYTE_SIZE]; - u8 encryptedPrivateKey[ENCRYPTION_CHECKSUM_BYTE_SIZE + PRIVATE_KEY_NUM_BYTES]; - - EncryptedPrivateKey(); - EncryptedPrivateKey(const EncryptedPrivateKey &other); - - // Throws DecryptionException if password (or salt) is wrong - Signature::PrivateKey decrypt(const DataView &plainPassword, const DataView &salt) const; - }; - - // Local user with encrypted private key - class LocalUserEncrypted - { - public: - static LocalUserEncrypted* create(const Signature::PublicKey &publicKey, const EncryptedPrivateKey &encryptedPrivateKey) - { - return new LocalUserEncrypted(publicKey, encryptedPrivateKey); - } - - const Signature::PublicKey& getPublicKey() const - { - return publicKey; - } - - const EncryptedPrivateKey& getPrivateKey() const - { - return encryptedPrivateKey; - } - private: - LocalUserEncrypted(const Signature::PublicKey &_publicKey, const EncryptedPrivateKey &_encryptedPrivateKey) : - publicKey(_publicKey), - encryptedPrivateKey(_encryptedPrivateKey) - { - - } - private: - Signature::PublicKey publicKey; - EncryptedPrivateKey encryptedPrivateKey; - }; -} |