14 #if defined(WITH_BOTAN) && !defined(WITH_BOTAN_BOOST)
27 class TlsContext :
public TlsContextBase {
31 virtual ~TlsContext() { }
36 explicit TlsContext(
TlsRole role);
42 virtual bool getCertRequired()
const;
49 virtual void setCertRequired(
bool cert_required);
56 virtual void loadCaFile(
const std::string& ca_file);
63 virtual void loadCaPath(
const std::string& ca_path);
70 virtual void loadCertFile(
const std::string& cert_file);
77 virtual void loadKeyFile(
const std::string& key_file);
83 friend class TlsContextBase;
87 typedef boost::asio::ip::tcp::socket TlsStreamImpl;
96 template <
typename Callback,
typename TlsStreamImpl>
99 : TlsStreamImpl(service.get_io_service()), role_(context->getRole()) {
105 template <
typename Callback>
106 class TlsStream :
public TlsStreamBase<Callback, TlsStreamImpl> {
110 typedef TlsStreamBase<Callback, TlsStreamImpl> Base;
118 : Base(service, context) {
122 virtual ~TlsStream() { }
125 virtual void handshake(Callback&) {
126 isc_throw(NotImplemented,
"Botan TLS is not yet supported");
130 virtual void shutdown(Callback&) {
131 isc_throw(NotImplemented,
"Botan TLS is not yet supported");
144 std::string getSubject() {
158 std::string getIssuer() {
166 #endif // WITH_BOTAN && !WITH_BOTAN_BOOST
168 #endif // BOTAN_TLS_H
boost::shared_ptr< TlsContext > TlsContextPtr
The type of shared pointers to TlsContext objects.
#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-dhcp-ddns.
TlsStreamBase(IOService &service, TlsContextPtr context)
Constructor.
A wrapper interface for the ASIO library.
TlsRole
Client and server roles.