Realistic 3D camera system
3D camera system components
password_callback.hpp
Go to the documentation of this file.
1 //
2 // ssl/detail/password_callback.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10 
11 #ifndef ASIO_SSL_DETAIL_PASSWORD_CALLBACK_HPP
12 #define ASIO_SSL_DETAIL_PASSWORD_CALLBACK_HPP
13 
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 
18 #include "asio/detail/config.hpp"
19 
20 #if !defined(ASIO_ENABLE_OLD_SSL)
21 # include <cstddef>
22 # include <string>
23 # include "asio/ssl/context_base.hpp"
24 #endif // !defined(ASIO_ENABLE_OLD_SSL)
25 
27 
28 namespace asio {
29 namespace ssl {
30 namespace detail {
31 
32 #if !defined(ASIO_ENABLE_OLD_SSL)
33 
35 {
36 public:
38  {
39  }
40 
41  virtual std::string call(std::size_t size,
42  context_base::password_purpose purpose) = 0;
43 };
44 
45 template <typename PasswordCallback>
47 {
48 public:
49  explicit password_callback(PasswordCallback callback)
50  : callback_(callback)
51  {
52  }
53 
54  virtual std::string call(std::size_t size,
56  {
57  return callback_(size, purpose);
58  }
59 
60 private:
61  PasswordCallback callback_;
62 };
63 
64 #endif // !defined(ASIO_ENABLE_OLD_SSL)
65 
66 } // namespace detail
67 } // namespace ssl
68 } // namespace asio
69 
71 
72 #endif // ASIO_SSL_DETAIL_PASSWORD_CALLBACK_HPP
password_purpose
Purpose of PEM password.
virtual std::string call(std::size_t size, context_base::password_purpose purpose)
password_callback(PasswordCallback callback)
virtual std::string call(std::size_t size, context_base::password_purpose purpose)=0