$search

asio::ssl::basic_context< Service > Class Template Reference

SSL context. More...

#include <basic_context.hpp>

Inheritance diagram for asio::ssl::basic_context< Service >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef service_type::impl_type impl_type
 The native implementation type of the locking dispatcher.
typedef Service service_type
 The type of the service that will be used to provide context operations.

Public Member Functions

asio::error_code add_verify_path (const std::string &path, asio::error_code &ec)
void add_verify_path (const std::string &path)
 basic_context (asio::io_service &io_service, method m)
 Constructor.
impl_type impl ()
 Get the underlying implementation in the native type.
asio::error_code load_verify_file (const std::string &filename, asio::error_code &ec)
 Load a certification authority file for performing verification.
void load_verify_file (const std::string &filename)
 Load a certification authority file for performing verification.
asio::error_code set_options (options o, asio::error_code &ec)
 Set options on the context.
void set_options (options o)
 Set options on the context.
template<typename PasswordCallback >
asio::error_code set_password_callback (PasswordCallback callback, asio::error_code &ec)
 Set the password callback.
template<typename PasswordCallback >
void set_password_callback (PasswordCallback callback)
 Set the password callback.
asio::error_code set_verify_mode (verify_mode v, asio::error_code &ec)
 Set the peer verification mode.
void set_verify_mode (verify_mode v)
 Set the peer verification mode.
asio::error_code use_certificate_chain_file (const std::string &filename, asio::error_code &ec)
 Use a certificate chain from a file.
void use_certificate_chain_file (const std::string &filename)
 Use a certificate chain from a file.
asio::error_code use_certificate_file (const std::string &filename, file_format format, asio::error_code &ec)
 Use a certificate from a file.
void use_certificate_file (const std::string &filename, file_format format)
 Use a certificate from a file.
asio::error_code use_private_key_file (const std::string &filename, file_format format, asio::error_code &ec)
 Use a private key from a file.
void use_private_key_file (const std::string &filename, file_format format)
 Use a private key from a file.
asio::error_code use_rsa_private_key_file (const std::string &filename, file_format format, asio::error_code &ec)
 Use an RSA private key from a file.
void use_rsa_private_key_file (const std::string &filename, file_format format)
 Use an RSA private key from a file.
asio::error_code use_tmp_dh_file (const std::string &filename, asio::error_code &ec)
 Use the specified file to obtain the temporary Diffie-Hellman parameters.
void use_tmp_dh_file (const std::string &filename)
 Use the specified file to obtain the temporary Diffie-Hellman parameters.
 ~basic_context ()
 Destructor.

Private Attributes

impl_type impl_
 The underlying native implementation.
service_typeservice_
 The backend service implementation.

Detailed Description

template<typename Service>
class asio::ssl::basic_context< Service >

SSL context.

Definition at line 36 of file basic_context.hpp.


Member Typedef Documentation

template<typename Service>
typedef service_type::impl_type asio::ssl::basic_context< Service >::impl_type

The native implementation type of the locking dispatcher.

Definition at line 45 of file basic_context.hpp.

template<typename Service>
typedef Service asio::ssl::basic_context< Service >::service_type

The type of the service that will be used to provide context operations.

Definition at line 42 of file basic_context.hpp.


Constructor & Destructor Documentation

template<typename Service>
asio::ssl::basic_context< Service >::basic_context ( asio::io_service io_service,
method  m 
) [inline]

Constructor.

Definition at line 48 of file basic_context.hpp.

template<typename Service>
asio::ssl::basic_context< Service >::~basic_context (  )  [inline]

Destructor.

Definition at line 56 of file basic_context.hpp.


Member Function Documentation

template<typename Service>
asio::error_code asio::ssl::basic_context< Service >::add_verify_path ( const std::string &  path,
asio::error_code ec 
) [inline]

Add a directory containing certificate authority files to be used for performing verification. This function is used to specify the name of a directory containing certification authority certificates. Each file in the directory must contain a single certificate. The files must be named using the subject name's hash and an extension of ".0".

Parameters:
path The name of a directory containing the certificates.
ec Set to indicate what error occurred, if any.

Definition at line 202 of file basic_context.hpp.

template<typename Service>
void asio::ssl::basic_context< Service >::add_verify_path ( const std::string &  path  )  [inline]

Add a directory containing certificate authority files to be used for performing verification. This function is used to specify the name of a directory containing certification authority certificates. Each file in the directory must contain a single certificate. The files must be named using the subject name's hash and an extension of ".0".

Parameters:
path The name of a directory containing the certificates.
Exceptions:
asio::system_error Thrown on failure.

Definition at line 183 of file basic_context.hpp.

template<typename Service>
impl_type asio::ssl::basic_context< Service >::impl (  )  [inline]

Get the underlying implementation in the native type.

This function may be used to obtain the underlying implementation of the context. This is intended to allow access to context functionality that is not otherwise provided.

Definition at line 67 of file basic_context.hpp.

template<typename Service>
asio::error_code asio::ssl::basic_context< Service >::load_verify_file ( const std::string &  filename,
asio::error_code ec 
) [inline]

Load a certification authority file for performing verification.

This function is used to load the certificates for one or more trusted certification authorities from a file.

Parameters:
filename The name of a file containing certification authority certificates in PEM format.
ec Set to indicate what error occurred, if any.

Definition at line 165 of file basic_context.hpp.

template<typename Service>
void asio::ssl::basic_context< Service >::load_verify_file ( const std::string &  filename  )  [inline]

Load a certification authority file for performing verification.

This function is used to load one or more trusted certification authorities from a file.

Parameters:
filename The name of a file containing certification authority certificates in PEM format.
Exceptions:
asio::system_error Thrown on failure.

Definition at line 148 of file basic_context.hpp.

template<typename Service>
asio::error_code asio::ssl::basic_context< Service >::set_options ( options  o,
asio::error_code ec 
) [inline]

Set options on the context.

This function may be used to configure the SSL options used by the context.

Parameters:
o A bitmask of options. The available option values are defined in the context_base class. The options are bitwise-ored with any existing value for the options.
ec Set to indicate what error occurred, if any.

Definition at line 99 of file basic_context.hpp.

template<typename Service>
void asio::ssl::basic_context< Service >::set_options ( options  o  )  [inline]

Set options on the context.

This function may be used to configure the SSL options used by the context.

Parameters:
o A bitmask of options. The available option values are defined in the context_base class. The options are bitwise-ored with any existing value for the options.
Exceptions:
asio::system_error Thrown on failure.

Definition at line 82 of file basic_context.hpp.

template<typename Service>
template<typename PasswordCallback >
asio::error_code asio::ssl::basic_context< Service >::set_password_callback ( PasswordCallback  callback,
asio::error_code ec 
) [inline]

Set the password callback.

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.

Definition at line 415 of file basic_context.hpp.

template<typename Service>
template<typename PasswordCallback >
void asio::ssl::basic_context< Service >::set_password_callback ( PasswordCallback  callback  )  [inline]

Set the password callback.

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.

Exceptions:
asio::system_error Thrown on failure.

Definition at line 392 of file basic_context.hpp.

template<typename Service>
asio::error_code asio::ssl::basic_context< Service >::set_verify_mode ( verify_mode  v,
asio::error_code ec 
) [inline]

Set the peer verification mode.

This function may be used to configure the peer verification mode used by the context.

Parameters:
v A bitmask of peer verification modes. The available verify_mode values are defined in the context_base class.
ec Set to indicate what error occurred, if any.

Definition at line 132 of file basic_context.hpp.

template<typename Service>
void asio::ssl::basic_context< Service >::set_verify_mode ( verify_mode  v  )  [inline]

Set the peer verification mode.

This function may be used to configure the peer verification mode used by the context.

Parameters:
v A bitmask of peer verification modes. The available verify_mode values are defined in the context_base class.
Exceptions:
asio::system_error Thrown on failure.

Definition at line 115 of file basic_context.hpp.

template<typename Service>
asio::error_code asio::ssl::basic_context< Service >::use_certificate_chain_file ( const std::string &  filename,
asio::error_code ec 
) [inline]

Use a certificate chain from a file.

This function is used to load a certificate chain into the context from a file.

Parameters:
filename The name of the file containing the certificate. The file must use the PEM format.
ec Set to indicate what error occurred, if any.

Definition at line 268 of file basic_context.hpp.

template<typename Service>
void asio::ssl::basic_context< Service >::use_certificate_chain_file ( const std::string &  filename  )  [inline]

Use a certificate chain from a file.

This function is used to load a certificate chain into the context from a file.

Parameters:
filename The name of the file containing the certificate. The file must use the PEM format.
Exceptions:
asio::system_error Thrown on failure.

Definition at line 251 of file basic_context.hpp.

template<typename Service>
asio::error_code asio::ssl::basic_context< Service >::use_certificate_file ( const std::string &  filename,
file_format  format,
asio::error_code ec 
) [inline]

Use a certificate from a file.

This function is used to load a certificate into the context from a file.

Parameters:
filename The name of the file containing the certificate.
format The file format (ASN.1 or PEM).
ec Set to indicate what error occurred, if any.

Definition at line 235 of file basic_context.hpp.

template<typename Service>
void asio::ssl::basic_context< Service >::use_certificate_file ( const std::string &  filename,
file_format  format 
) [inline]

Use a certificate from a file.

This function is used to load a certificate into the context from a file.

Parameters:
filename The name of the file containing the certificate.
format The file format (ASN.1 or PEM).
Exceptions:
asio::system_error Thrown on failure.

Definition at line 218 of file basic_context.hpp.

template<typename Service>
asio::error_code asio::ssl::basic_context< Service >::use_private_key_file ( const std::string &  filename,
file_format  format,
asio::error_code ec 
) [inline]

Use a private key from a file.

This function is used to load a private key into the context from a file.

Parameters:
filename The name of the file containing the private key.
format The file format (ASN.1 or PEM).
ec Set to indicate what error occurred, if any.

Definition at line 301 of file basic_context.hpp.

template<typename Service>
void asio::ssl::basic_context< Service >::use_private_key_file ( const std::string &  filename,
file_format  format 
) [inline]

Use a private key from a file.

This function is used to load a private key into the context from a file.

Parameters:
filename The name of the file containing the private key.
format The file format (ASN.1 or PEM).
Exceptions:
asio::system_error Thrown on failure.

Definition at line 284 of file basic_context.hpp.

template<typename Service>
asio::error_code asio::ssl::basic_context< Service >::use_rsa_private_key_file ( const std::string &  filename,
file_format  format,
asio::error_code ec 
) [inline]

Use an RSA private key from a file.

This function is used to load an RSA private key into the context from a file.

Parameters:
filename The name of the file containing the RSA private key.
format The file format (ASN.1 or PEM).
ec Set to indicate what error occurred, if any.

Definition at line 336 of file basic_context.hpp.

template<typename Service>
void asio::ssl::basic_context< Service >::use_rsa_private_key_file ( const std::string &  filename,
file_format  format 
) [inline]

Use an RSA private key from a file.

This function is used to load an RSA private key into the context from a file.

Parameters:
filename The name of the file containing the RSA private key.
format The file format (ASN.1 or PEM).
Exceptions:
asio::system_error Thrown on failure.

Definition at line 318 of file basic_context.hpp.

template<typename Service>
asio::error_code asio::ssl::basic_context< Service >::use_tmp_dh_file ( const std::string &  filename,
asio::error_code ec 
) [inline]

Use the specified file to obtain the temporary Diffie-Hellman parameters.

This function is used to load Diffie-Hellman parameters into the context from a file.

Parameters:
filename The name of the file containing the Diffie-Hellman parameters. The file must use the PEM format.
ec Set to indicate what error occurred, if any.

Definition at line 370 of file basic_context.hpp.

template<typename Service>
void asio::ssl::basic_context< Service >::use_tmp_dh_file ( const std::string &  filename  )  [inline]

Use the specified file to obtain the temporary Diffie-Hellman parameters.

This function is used to load Diffie-Hellman parameters into the context from a file.

Parameters:
filename The name of the file containing the Diffie-Hellman parameters. The file must use the PEM format.
Exceptions:
asio::system_error Thrown on failure.

Definition at line 353 of file basic_context.hpp.


Member Data Documentation

template<typename Service>
impl_type asio::ssl::basic_context< Service >::impl_ [private]

The underlying native implementation.

Definition at line 426 of file basic_context.hpp.

template<typename Service>
service_type& asio::ssl::basic_context< Service >::service_ [private]

The backend service implementation.

Definition at line 423 of file basic_context.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Castor
Author(s): Carpe Noctem
autogenerated on Fri Mar 1 14:41:50 2013