diff options
author | Aleksi Lindeman <aleksi_888@hotmail.com> | 2018-02-10 03:38:47 +0100 |
---|---|---|
committer | Aleksi Lindeman <aleksi_888@hotmail.com> | 2018-02-10 03:39:41 +0100 |
commit | be3c931f9b2db357c0b4306ad248c968d90254a3 (patch) | |
tree | 8b7943e750c27ed0be07c0354827eb3856423a71 /include/LocalUser.hpp | |
parent | 28efc0068f47ec787791a07a63d720710068c095 (diff) |
Add private/public key for users
Diffstat (limited to 'include/LocalUser.hpp')
-rw-r--r-- | include/LocalUser.hpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/LocalUser.hpp b/include/LocalUser.hpp index 200f30f..04f483d 100644 --- a/include/LocalUser.hpp +++ b/include/LocalUser.hpp @@ -7,11 +7,23 @@ namespace odhtdb class LocalUser : public User { public: - static LocalUser* create(const std::string &name) + static LocalUser* create(const Signature::KeyPair &keyPair, const std::string &name) { - return new LocalUser(name); + return new LocalUser(keyPair, name); } + + const Signature::PublicKey& getPublicKey() const override + { + return keyPair.getPublicKey(); + } + + const Signature::PrivateKey& getPrivateKey() const + { + return keyPair.getPrivateKey(); + } + private: + LocalUser(const Signature::KeyPair &_keyPair, const std::string &name) : User(name), keyPair(_keyPair) {} private: - LocalUser(const std::string &name) : User(name){} + Signature::KeyPair keyPair; }; -}
\ No newline at end of file +} |