Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext
ssl::basic_context::set_password_callback (2 of 2 overloads)

Set the password callback.

template<
    typename PasswordCallback>
boost::system::error_code set_password_callback(
    PasswordCallback callback,
    boost::system::error_code & ec);

This function is used to specify a callback function to obtain password information about an encrypted key in PEM format.

Parameters

callback

The function object to be used for obtaining the password. The function signature of the handler must be:

std::string password_callback(
  std::size_t max_length,  // The maximum size for a password.
  password_purpose purpose // Whether password is for reading or writing.
); 

The return value of the callback is a string containing the password.

ec

Set to indicate what error occurred, if any.


PrevUpHomeNext