aboutsummaryrefslogtreecommitdiff
path: root/include/odhtdb/LocalUser.hpp
blob: 0312a38a9f0fdc860a14eeaec95cb7bb6fea41e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once

#include "User.hpp"
#include "types.hpp"

namespace odhtdb
{
    class LocalUser : public User
    {
    public:
        static LocalUser* create(const Signature::KeyPair &keyPair, const std::string &name, Group *group, const std::string &plainPassword)
        {
            return new LocalUser(keyPair, name, group, plainPassword);
        }
        
        const Signature::PublicKey& getPublicKey() const override
        {
            return keyPair.getPublicKey();
        }
        
        const Signature::PrivateKey& getPrivateKey() const
        {
            return keyPair.getPrivateKey();
        }
        
        const std::string& getPlainPassword() const
        {
            return plainPassword;
        }
    private:
        LocalUser(const Signature::KeyPair &_keyPair, const std::string &name, Group *group, const std::string &plainPassword);
    private:
        Signature::KeyPair keyPair;
        std::string plainPassword;
    };
}