TLS context base class.
More...
#include <common_tls.h>
|
static void | configure (TlsContextPtr &context, TlsRole role, const std::string &ca_file, const std::string &cert_file, const std::string &key_file, bool cert_required=true) |
| Configure. More...
|
|
|
virtual void | loadCaFile (const std::string &ca_file)=0 |
| Load the trust anchor aka certification authority. More...
|
|
virtual void | loadCaPath (const std::string &ca_path)=0 |
| Load the trust anchor aka certification authority. More...
|
|
virtual void | loadCertFile (const std::string &cert_file)=0 |
| Load the certificate file. More...
|
|
virtual void | loadKeyFile (const std::string &key_file)=0 |
| Load the private key from a file. More...
|
|
virtual void | setCertRequired (bool cert_required)=0 |
| Set the peer certificate requirement mode. More...
|
|
TLS context base class.
Definition at line 40 of file common_tls.h.
virtual isc::asiolink::TlsContextBase::~TlsContextBase |
( |
| ) |
|
|
inlinevirtual |
isc::asiolink::TlsContextBase::TlsContextBase |
( |
TlsRole |
role | ) |
|
|
inlineexplicit |
Create a fresh context.
- Parameters
-
role | The TLS role client or server. |
Definition at line 48 of file common_tls.h.
void isc::asiolink::TlsContextBase::configure |
( |
TlsContextPtr & |
context, |
|
|
TlsRole |
role, |
|
|
const std::string & |
ca_file, |
|
|
const std::string & |
cert_file, |
|
|
const std::string & |
key_file, |
|
|
bool |
cert_required = true |
|
) |
| |
|
static |
Configure.
- Note
- No need for a role set method.
- Parameters
-
context | The TLS context to configure. |
role | The TLS role client or server. |
ca_file | The certificate file or directory name. |
cert_file | The certificate file name. |
key_file | The private key file name. |
cert_required | True if peer certificates are required, false if they are optional. This is a server specific parameter. |
- Exceptions
-
Definition at line 36 of file common_tls.cc.
References isc_throw, and isc::Exception::what().
virtual bool isc::asiolink::TlsContextBase::getCertRequired |
( |
| ) |
const |
|
pure virtual |
Get the peer certificate requirement mode.
- Returns
- True if peer certificates are required, false if they are optional.
TlsRole isc::asiolink::TlsContextBase::getRole |
( |
| ) |
const |
|
inline |
virtual void isc::asiolink::TlsContextBase::loadCaFile |
( |
const std::string & |
ca_file | ) |
|
|
protectedpure virtual |
Load the trust anchor aka certification authority.
- Parameters
-
ca_file | The certificate file name. |
- Exceptions
-
virtual void isc::asiolink::TlsContextBase::loadCaPath |
( |
const std::string & |
ca_path | ) |
|
|
protectedpure virtual |
Load the trust anchor aka certification authority.
- Parameters
-
ca_path | The certificate directory name. |
- Exceptions
-
virtual void isc::asiolink::TlsContextBase::loadCertFile |
( |
const std::string & |
cert_file | ) |
|
|
protectedpure virtual |
Load the certificate file.
- Parameters
-
cert_file | The certificate file name. |
- Exceptions
-
virtual void isc::asiolink::TlsContextBase::loadKeyFile |
( |
const std::string & |
key_file | ) |
|
|
protectedpure virtual |
Load the private key from a file.
- Parameters
-
key_file | The private key file name. |
- Exceptions
-
virtual void isc::asiolink::TlsContextBase::setCertRequired |
( |
bool |
cert_required | ) |
|
|
protectedpure virtual |
Set the peer certificate requirement mode.
- Parameters
-
cert_required | True if peer certificates are required, false if they are optional. |
- Exceptions
-
TlsRole isc::asiolink::TlsContextBase::role_ |
The documentation for this class was generated from the following files: