Chris@16
|
1 //
|
Chris@16
|
2 // ssl/verify_context.hpp
|
Chris@16
|
3 // ~~~~~~~~~~~~~~~~~~~~~~
|
Chris@16
|
4 //
|
Chris@101
|
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
Chris@16
|
6 //
|
Chris@16
|
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
9 //
|
Chris@16
|
10
|
Chris@16
|
11 #ifndef BOOST_ASIO_SSL_VERIFY_CONTEXT_HPP
|
Chris@16
|
12 #define BOOST_ASIO_SSL_VERIFY_CONTEXT_HPP
|
Chris@16
|
13
|
Chris@16
|
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
Chris@16
|
15 # pragma once
|
Chris@16
|
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
|
Chris@16
|
17
|
Chris@16
|
18 #include <boost/asio/detail/config.hpp>
|
Chris@16
|
19
|
Chris@16
|
20 #if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
|
Chris@16
|
21 # include <boost/asio/detail/noncopyable.hpp>
|
Chris@16
|
22 # include <boost/asio/ssl/detail/openssl_types.hpp>
|
Chris@16
|
23 #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
|
Chris@16
|
24
|
Chris@16
|
25 #include <boost/asio/detail/push_options.hpp>
|
Chris@16
|
26
|
Chris@16
|
27 namespace boost {
|
Chris@16
|
28 namespace asio {
|
Chris@16
|
29 namespace ssl {
|
Chris@16
|
30
|
Chris@16
|
31 #if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
|
Chris@16
|
32
|
Chris@16
|
33 /// A simple wrapper around the X509_STORE_CTX type, used during verification of
|
Chris@16
|
34 /// a peer certificate.
|
Chris@16
|
35 /**
|
Chris@16
|
36 * @note The verify_context does not own the underlying X509_STORE_CTX object.
|
Chris@16
|
37 */
|
Chris@16
|
38 class verify_context
|
Chris@16
|
39 : private noncopyable
|
Chris@16
|
40 {
|
Chris@16
|
41 public:
|
Chris@16
|
42 /// The native handle type of the verification context.
|
Chris@16
|
43 typedef X509_STORE_CTX* native_handle_type;
|
Chris@16
|
44
|
Chris@16
|
45 /// Constructor.
|
Chris@16
|
46 explicit verify_context(native_handle_type handle)
|
Chris@16
|
47 : handle_(handle)
|
Chris@16
|
48 {
|
Chris@16
|
49 }
|
Chris@16
|
50
|
Chris@16
|
51 /// Get the underlying implementation in the native type.
|
Chris@16
|
52 /**
|
Chris@16
|
53 * This function may be used to obtain the underlying implementation of the
|
Chris@16
|
54 * context. This is intended to allow access to context functionality that is
|
Chris@16
|
55 * not otherwise provided.
|
Chris@16
|
56 */
|
Chris@16
|
57 native_handle_type native_handle()
|
Chris@16
|
58 {
|
Chris@16
|
59 return handle_;
|
Chris@16
|
60 }
|
Chris@16
|
61
|
Chris@16
|
62 private:
|
Chris@16
|
63 // The underlying native implementation.
|
Chris@16
|
64 native_handle_type handle_;
|
Chris@16
|
65 };
|
Chris@16
|
66
|
Chris@16
|
67 #endif // defined(BOOST_ASIO_ENABLE_OLD_SSL)
|
Chris@16
|
68
|
Chris@16
|
69 } // namespace ssl
|
Chris@16
|
70 } // namespace asio
|
Chris@16
|
71 } // namespace boost
|
Chris@16
|
72
|
Chris@16
|
73 #include <boost/asio/detail/pop_options.hpp>
|
Chris@16
|
74
|
Chris@16
|
75 #endif // BOOST_ASIO_SSL_VERIFY_CONTEXT_HPP
|