aboutsummaryrefslogtreecommitdiff
path: root/include/LocalUser.hpp
blob: 04f483d5cc44c5653e7d5c6100436581d5bf4c7c (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
#pragma once

#include "User.hpp"

namespace odhtdb
{
    class LocalUser : public User
    {
    public:
        static LocalUser* create(const Signature::KeyPair &keyPair, const std::string &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:
        Signature::KeyPair keyPair;
    };
}