Realistic 3D camera system
3D camera system components
context_service.hpp
Go to the documentation of this file.
1 //
2 // ssl/old/context_service.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
6 // Copyright (c) 2005-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 //
8 // Distributed under the Boost Software License, Version 1.0. (See accompanying
9 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
10 //
11 
12 #ifndef ASIO_SSL_OLD_CONTEXT_SERVICE_HPP
13 #define ASIO_SSL_OLD_CONTEXT_SERVICE_HPP
14 
15 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 # pragma once
17 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 
19 #include "asio/detail/config.hpp"
20 #include <string>
21 #include <boost/noncopyable.hpp>
22 #include "asio/error.hpp"
23 #include "asio/io_service.hpp"
26 
28 
29 namespace asio {
30 namespace ssl {
31 namespace old {
32 
35 #if defined(GENERATING_DOCUMENTATION)
37 #else
38  : public asio::detail::service_base<context_service>
39 #endif
40 {
41 private:
42  // The type of the platform-specific implementation.
44 
45 public:
46 #if defined(GENERATING_DOCUMENTATION)
47  static asio::io_service::id id;
49 #endif
50 
52 #if defined(GENERATING_DOCUMENTATION)
53  typedef implementation_defined impl_type;
54 #else
56 #endif
57 
60  : asio::detail::service_base<context_service>(io_service),
61  service_impl_(asio::use_service<service_impl_type>(io_service))
62  {
63  }
64 
66  impl_type null() const
67  {
68  return service_impl_.null();
69  }
70 
72  void create(impl_type& impl, context_base::method m)
73  {
74  service_impl_.create(impl, m);
75  }
76 
78  void destroy(impl_type& impl)
79  {
80  service_impl_.destroy(impl);
81  }
82 
84  asio::error_code set_options(impl_type& impl,
86  {
87  return service_impl_.set_options(impl, o, ec);
88  }
89 
93  {
94  return service_impl_.set_verify_mode(impl, v, ec);
95  }
96 
99  const std::string& filename, asio::error_code& ec)
100  {
101  return service_impl_.load_verify_file(impl, filename, ec);
102  }
103 
107  const std::string& path, asio::error_code& ec)
108  {
109  return service_impl_.add_verify_path(impl, path, ec);
110  }
111 
114  const std::string& filename, context_base::file_format format,
115  asio::error_code& ec)
116  {
117  return service_impl_.use_certificate_file(impl, filename, format, ec);
118  }
119 
122  const std::string& filename, asio::error_code& ec)
123  {
124  return service_impl_.use_certificate_chain_file(impl, filename, ec);
125  }
126 
129  const std::string& filename, context_base::file_format format,
130  asio::error_code& ec)
131  {
132  return service_impl_.use_private_key_file(impl, filename, format, ec);
133  }
134 
137  const std::string& filename, context_base::file_format format,
138  asio::error_code& ec)
139  {
140  return service_impl_.use_rsa_private_key_file(impl, filename, format, ec);
141  }
142 
145  const std::string& filename, asio::error_code& ec)
146  {
147  return service_impl_.use_tmp_dh_file(impl, filename, ec);
148  }
149 
151  template <typename PasswordCallback>
153  PasswordCallback callback, asio::error_code& ec)
154  {
155  return service_impl_.set_password_callback(impl, callback, ec);
156  }
157 
158 private:
159  // Destroy all user-defined handler objects owned by the service.
160  void shutdown_service()
161  {
162  }
163 
164  // The service that provides the platform-specific implementation.
165  service_impl_type& service_impl_;
166 };
167 
168 } // namespace old
169 } // namespace ssl
170 } // namespace asio
171 
173 
174 #endif // ASIO_SSL_OLD_CONTEXT_SERVICE_HPP
asio::error_code set_verify_mode(impl_type &impl, context_base::verify_mode v, asio::error_code &ec)
asio::error_code load_verify_file(impl_type &impl, const std::string &filename, asio::error_code &ec)
context_service(asio::io_service &io_service)
Constructor.
impl_type null() const
Return a null context implementation.
Class used to uniquely identify a service.
Definition: io_service.hpp:665
Provides core I/O functionality.
Definition: io_service.hpp:184
asio::error_code set_password_callback(impl_type &impl, PasswordCallback callback, asio::error_code &ec)
Set the password callback.
void destroy(impl_type &impl)
Destroy a context implementation.
asio::error_code set_password_callback(impl_type &impl, Password_Callback callback, asio::error_code &ec)
Service & use_service(io_service &ios)
Definition: io_service.hpp:26
asio::error_code use_rsa_private_key_file(impl_type &impl, const std::string &filename, context_base::file_format format, asio::error_code &ec)
Use an RSA private key from a file.
void create(impl_type &impl, context_base::method m)
Create a new context implementation.
asio::error_code use_tmp_dh_file(impl_type &impl, const std::string &filename, asio::error_code &ec)
asio::error_code use_certificate_chain_file(impl_type &impl, const std::string &filename, asio::error_code &ec)
asio::error_code use_tmp_dh_file(impl_type &impl, const std::string &filename, asio::error_code &ec)
Use the specified file to obtain the temporary Diffie-Hellman parameters.
asio::error_code add_verify_path(impl_type &impl, const std::string &path, asio::error_code &ec)
asio::error_code set_options(impl_type &impl, context_base::options o, asio::error_code &ec)
Set options on the context.
method
Different methods supported by a context.
asio::error_code use_private_key_file(impl_type &impl, const std::string &filename, context_base::file_format format, asio::error_code &ec)
asio::error_code use_rsa_private_key_file(impl_type &impl, const std::string &filename, context_base::file_format format, asio::error_code &ec)
service_impl_type::impl_type impl_type
The type of the context.
asio::error_code set_options(impl_type &impl, context_base::options o, asio::error_code &ec)
asio::error_code use_certificate_file(impl_type &impl, const std::string &filename, context_base::file_format format, asio::error_code &ec)
asio::error_code load_verify_file(impl_type &impl, const std::string &filename, asio::error_code &ec)
Load a certification authority file for performing verification.
Class to represent an error code value.
Definition: error_code.hpp:80
asio::error_code use_certificate_chain_file(impl_type &impl, const std::string &filename, asio::error_code &ec)
Use a certificate chain from a file.
void create(impl_type &impl, context_base::method m)
asio::error_code set_verify_mode(impl_type &impl, context_base::verify_mode v, asio::error_code &ec)
Set peer verification mode.
static asio::detail::service_id< context_service > id
Definition: io_service.hpp:748
asio::error_code use_private_key_file(impl_type &impl, const std::string &filename, context_base::file_format format, asio::error_code &ec)
Use a private key from a file.
asio::error_code add_verify_path(impl_type &impl, const std::string &path, asio::error_code &ec)
service_base(asio::io_service &io_service)
Definition: io_service.hpp:751
long options
Bitmask type for SSL options.
Base class for all io_service services.
Definition: io_service.hpp:674
asio::error_code use_certificate_file(impl_type &impl, const std::string &filename, context_base::file_format format, asio::error_code &ec)
Use a certificate from a file.
file_format
File format types.
Default service implementation for a context.