123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- #ifndef BOOST_ASIO_SSL_CONTEXT_SERVICE_HPP
- #define BOOST_ASIO_SSL_CONTEXT_SERVICE_HPP
- #if defined(_MSC_VER) && (_MSC_VER >= 1200)
- # pragma once
- #endif
- #include <boost/asio/detail/push_options.hpp>
- #include <boost/asio/detail/push_options.hpp>
- #include <string>
- #include <boost/noncopyable.hpp>
- #include <boost/asio/detail/pop_options.hpp>
- #include <boost/asio/error.hpp>
- #include <boost/asio/io_service.hpp>
- #include <boost/asio/detail/service_base.hpp>
- #include <boost/asio/ssl/context_base.hpp>
- #include <boost/asio/ssl/detail/openssl_context_service.hpp>
- namespace boost {
- namespace asio {
- namespace ssl {
- class context_service
- #if defined(GENERATING_DOCUMENTATION)
- : public boost::asio::io_service::service
- #else
- : public boost::asio::detail::service_base<context_service>
- #endif
- {
- private:
-
- typedef detail::openssl_context_service service_impl_type;
- public:
- #if defined(GENERATING_DOCUMENTATION)
-
- static boost::asio::io_service::id id;
- #endif
-
- #if defined(GENERATING_DOCUMENTATION)
- typedef implementation_defined impl_type;
- #else
- typedef service_impl_type::impl_type impl_type;
- #endif
-
- explicit context_service(boost::asio::io_service& io_service)
- : boost::asio::detail::service_base<context_service>(io_service),
- service_impl_(boost::asio::use_service<service_impl_type>(io_service))
- {
- }
-
- void shutdown_service()
- {
- }
-
- impl_type null() const
- {
- return service_impl_.null();
- }
-
- void create(impl_type& impl, context_base::method m)
- {
- service_impl_.create(impl, m);
- }
-
- void destroy(impl_type& impl)
- {
- service_impl_.destroy(impl);
- }
-
- boost::system::error_code set_options(impl_type& impl,
- context_base::options o, boost::system::error_code& ec)
- {
- return service_impl_.set_options(impl, o, ec);
- }
-
- boost::system::error_code set_verify_mode(impl_type& impl,
- context_base::verify_mode v, boost::system::error_code& ec)
- {
- return service_impl_.set_verify_mode(impl, v, ec);
- }
-
- boost::system::error_code load_verify_file(impl_type& impl,
- const std::string& filename, boost::system::error_code& ec)
- {
- return service_impl_.load_verify_file(impl, filename, ec);
- }
-
-
- boost::system::error_code add_verify_path(impl_type& impl,
- const std::string& path, boost::system::error_code& ec)
- {
- return service_impl_.add_verify_path(impl, path, ec);
- }
-
- boost::system::error_code use_certificate_file(impl_type& impl,
- const std::string& filename, context_base::file_format format,
- boost::system::error_code& ec)
- {
- return service_impl_.use_certificate_file(impl, filename, format, ec);
- }
-
- boost::system::error_code use_certificate_chain_file(impl_type& impl,
- const std::string& filename, boost::system::error_code& ec)
- {
- return service_impl_.use_certificate_chain_file(impl, filename, ec);
- }
-
- boost::system::error_code use_private_key_file(impl_type& impl,
- const std::string& filename, context_base::file_format format,
- boost::system::error_code& ec)
- {
- return service_impl_.use_private_key_file(impl, filename, format, ec);
- }
-
- boost::system::error_code use_rsa_private_key_file(impl_type& impl,
- const std::string& filename, context_base::file_format format,
- boost::system::error_code& ec)
- {
- return service_impl_.use_rsa_private_key_file(impl, filename, format, ec);
- }
-
- boost::system::error_code use_tmp_dh_file(impl_type& impl,
- const std::string& filename, boost::system::error_code& ec)
- {
- return service_impl_.use_tmp_dh_file(impl, filename, ec);
- }
-
- template <typename PasswordCallback>
- boost::system::error_code set_password_callback(impl_type& impl,
- PasswordCallback callback, boost::system::error_code& ec)
- {
- return service_impl_.set_password_callback(impl, callback, ec);
- }
- private:
-
- service_impl_type& service_impl_;
- };
- }
- }
- }
- #include <boost/asio/detail/pop_options.hpp>
- #endif
|