Paths to the files containing a TLS certificate and the associated private key.
More...
#include <xentara/security/CertificatePaths.hpp>
Paths to the files containing a TLS certificate and the associated private key.
This class implements all the functionality necessary for using structured bindings. This means that you can bind individual names to the two certificate paths using structured binding syntax:
constexpr auto privateKeyPath() const noexcept -> const std::filesystem::path &
Gets the path to the PEM file containing the private key.
Definition CertificatePaths.hpp:64
constexpr auto certificatePath() const noexcept -> const std::filesystem::path &
Gets the path to the PEM file containing the certificate.
Definition CertificatePaths.hpp:58
◆ CertificatePaths() [1/2]
xentara::security::CertificatePaths::CertificatePaths |
( |
| ) |
|
|
default |
Default constructor.
This constructor creates a dummy object that contains empty paths for both the certificate and the private key.
◆ CertificatePaths() [2/2]
xentara::security::CertificatePaths::CertificatePaths |
( |
CertificatePath && |
certificatePath, |
|
|
PrivateKeyPath && |
privateKeyPath |
|
) |
| |
Constructor that sets the paths.
- Parameters
-
certificatePath | The absolute path to the PEM file containing the certificate, or an empty path to create an empty object. If the path is empty, privateKeyPath must also be empty. |
privateKeyPath | The absolute path to the PEM file containing the private key, or an empty path to create an empty object. If the path is empty, certificatePath must also be empty. |
◆ certificatePath()
constexpr auto xentara::security::CertificatePaths::certificatePath |
( |
| ) |
const -> const std::filesystem::path &
|
|
constexprnoexcept |
Gets the path to the PEM file containing the certificate.
◆ certificateSubdirectory()
Gets the config sub-directory for certificates.
This function returns the subdirectory below the actual config directories that this class uses when searching for certificates if the path in the configuration file is relative.
- Returns
- The subdirectory for certificates below the actual config directories. This path can be passed to config::Context::findConfigFile() to search for custom files in the certificate directories.
◆ empty()
auto xentara::security::CertificatePaths::empty |
( |
| ) |
const -> bool
|
|
noexcept |
Checks whether the object contains any paths.
- Returns
- true if both the certificate path and the private key path are empty, or false if at least one of the paths is non-empty.
◆ load()
Loads the certificate paths from a value.
- Parameters
-
value | The value to load the certificate paths from |
context | The configuration context. |
- Exceptions
-
◆ privateKeyPath()
constexpr auto xentara::security::CertificatePaths::privateKeyPath |
( |
| ) |
const -> const std::filesystem::path &
|
|
constexprnoexcept |
Gets the path to the PEM file containing the private key.
◆ privateKeySubdirectory()
Gets the config sub-directory for private keys.
This function returns the subdirectory below the actual config directories that this class uses when searching for private keys if the path in the configuration file is relative.
- Returns
- The subdirectory for certificates below the actual config directories. This path can be passed to config::Context::findConfigFile() to search for custom files in the private key directories.