boost::corosio::tls_context::use_private_key_file
Load the private key from a file.
Synopsis
Declared in <boost/corosio/tls_context.hpp>
std::error_code
use_private_key_file(
std::string_view filename,
tls_file_format format);
Description
Sets the private key corresponding to the entity certificate. The key must match the certificate loaded via use_certificate_file() or use_certificate_chain_file().
If the key file is encrypted, set a password callback via set_password_callback() before calling this function.
Return Value
Success, or an error if the file could not be read, the key is invalid, or it doesn't match the certificate.
Parameters
| Name | Description |
|---|---|
filename |
Path to the private key file. |
format |
The encoding format of the file. |