boost::corosio::tls_context::use_private_key

Load the private key from a memory buffer.

Synopsis

std::error_code
use_private_key(
    std::string_view private_key,
    tls_file_format format);

Description

Sets the private key corresponding to the entity certificate. The key must match the certificate loaded via use_certificate() or use_certificate_chain().

If the key is encrypted, set a password callback via set_password_callback() before calling this function.

Return Value

Success, or an error if the key could not be parsed, is encrypted without a password callback, or doesn't match the certificate.

Parameters

Name Description

private_key

The private key data.

format

The encoding format of the key data.

See Also

use_private_key_file

set_password_callback

Created with MrDocs