forked from open-eid/libdigidocpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConf.h
More file actions
131 lines (107 loc) · 3.25 KB
/
Conf.h
File metadata and controls
131 lines (107 loc) · 3.25 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
* libdigidocpp
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#pragma once
#include "Exports.h"
#include <set>
#include <string>
#include <vector>
namespace digidoc
{
class X509Cert;
class DIGIDOCPP_EXPORT Conf
{
public:
Conf();
virtual ~Conf();
static void init(Conf *conf);
static Conf* instance();
virtual int logLevel() const;
virtual std::string logFile() const;
DIGIDOCPP_DEPRECATED virtual std::string libdigidocConf() const;
DIGIDOCPP_DEPRECATED virtual std::string certsPath() const;
virtual std::string xsdPath() const;
virtual std::string PKCS11Driver() const;
virtual std::string proxyHost() const;
virtual std::string proxyPort() const;
virtual std::string proxyUser() const;
virtual std::string proxyPass() const;
virtual bool proxyForceSSL() const;
virtual bool proxyTunnelSSL() const;
virtual std::string digestUri() const;
virtual std::string signatureDigestUri() const;
virtual std::string ocsp(const std::string &issuer) const;
virtual std::string TSUrl() const;
virtual std::string verifyServiceUri() const;
virtual std::string PKCS12Cert() const;
virtual std::string PKCS12Pass() const;
virtual bool PKCS12Disable() const;
virtual bool TSLAllowExpired() const;
virtual bool TSLAutoUpdate() const;
virtual std::string TSLCache() const;
virtual std::vector<X509Cert> TSLCerts() const;
virtual bool TSLOnlineDigest() const;
virtual int TSLTimeOut() const;
virtual std::string TSLUrl() const;
private:
DISABLE_COPY(Conf);
static Conf *INSTANCE;
};
class DIGIDOCPP_EXPORT ConfV2: public Conf
{
public:
ConfV2();
~ConfV2() override;
static ConfV2* instance();
virtual X509Cert verifyServiceCert() const;
private:
DISABLE_COPY(ConfV2);
};
class DIGIDOCPP_EXPORT ConfV3: public ConfV2
{
public:
ConfV3();
~ConfV3() override;
static ConfV3* instance();
virtual std::set<std::string> OCSPTMProfiles() const;
private:
DISABLE_COPY(ConfV3);
};
class DIGIDOCPP_EXPORT ConfV4: public ConfV3
{
public:
ConfV4();
~ConfV4() override;
static ConfV4* instance();
virtual std::vector<X509Cert> verifyServiceCerts() const;
private:
DISABLE_COPY(ConfV4);
};
class DIGIDOCPP_EXPORT ConfV5: public ConfV4
{
public:
ConfV5();
~ConfV5() override;
static ConfV5* instance();
virtual std::vector<X509Cert> TSCerts() const;
private:
DISABLE_COPY(ConfV5);
};
using ConfCurrent = ConfV5;
#define CONF(method) (ConfCurrent::instance() ? ConfCurrent::instance()->method() : ConfCurrent().method())
}