Kea 2.7.0
botan_tls.cc
Go to the documentation of this file.
1// Copyright (C) 2021 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
8
9#include <config.h>
10
11#if defined(WITH_BOTAN) && !defined(WITH_BOTAN_BOOST)
12
14#include <asiolink/crypto_tls.h>
15
16namespace isc {
17namespace asiolink {
18
19TlsContext::TlsContext(TlsRole role)
20 : TlsContextBase(role), cert_required_(true) {
21}
22
23void
24TlsContext::setCertRequired(bool cert_required) {
25 if (!cert_required && (getRole() == TlsRole::CLIENT)) {
26 isc_throw(BadValue,
27 "'cert-required' parameter must be true for a TLS client");
28 }
29 cert_required_ = cert_required;
30}
31
32bool
33TlsContext::getCertRequired() const {
34 return (cert_required_);
35}
36
37void
38TlsContext::loadCaFile(const std::string&) {
39 isc_throw(NotImplemented, "Botan TLS is not yet supported");
40}
41
42void
43TlsContext::loadCaPath(const std::string&) {
44 isc_throw(NotImplemented, "loadCaPath is not implemented by Botan");
45}
46
47void
48TlsContext::loadCertFile(const std::string&) {
49 isc_throw(NotImplemented, "Botan TLS is not yet supported");
50}
51
52void
53TlsContext::loadKeyFile(const std::string&) {
54 isc_throw(NotImplemented, "Botan TLS is not yet supported");
55}
56
57} // namespace asiolink
58} // namespace isc
59
60#endif // WITH_BOTAN && !WITH_BOTAN_BOOST
TLS API.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Defines the logger used by the top-level component of kea-lfc.