blob: 874888cd77f6315be81066949b6f2acdf9c89664 (
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
37
38
39
40
41
42
43
44
45
46
|
/*
* Copyright (C) 2022-2024 Konsulko Group
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _KUKSA_CONFIG_H
#define _KUKSA_CONFIG_H
#include <string>
#define DEFAULT_KUKSA_PORT 55555
#define DEFAULT_KUKSA_CA_CERT_FILE "/etc/kuksa-val/CA.pem"
class KuksaConfig
{
public:
KuksaConfig();
explicit KuksaConfig(const std::string &hostname,
const unsigned port,
const bool useTls,
const std::string &caCert,
const std::string &tlsServerName,
const std::string &authToken);
~KuksaConfig(){};
std::string hostname() { return m_hostname; };
unsigned port() { return m_port; };
bool useTls() { return m_useTls; };
std::string caCert() { return m_caCert; };
std::string tlsServerName() { return m_tlsServerName; };
std::string authToken() { return m_authToken; };
bool valid() { return m_valid; };
private:
std::string m_hostname;
unsigned m_port;
bool m_useTls;
std::string m_caCert;
std::string m_tlsServerName;
std::string m_authToken;
bool m_valid = false;
};
#endif // _KUKSA_CONFIG_H
|