Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:33:36

0001 //
0002 // ssl/verify_context.hpp
0003 // ~~~~~~~~~~~~~~~~~~~~~~
0004 //
0005 // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 //
0010 
0011 #ifndef BOOST_ASIO_SSL_VERIFY_CONTEXT_HPP
0012 #define BOOST_ASIO_SSL_VERIFY_CONTEXT_HPP
0013 
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
0017 
0018 #include <boost/asio/detail/config.hpp>
0019 
0020 #include <boost/asio/detail/noncopyable.hpp>
0021 #include <boost/asio/ssl/detail/openssl_types.hpp>
0022 
0023 #include <boost/asio/detail/push_options.hpp>
0024 
0025 namespace boost {
0026 namespace asio {
0027 namespace ssl {
0028 
0029 /// A simple wrapper around the X509_STORE_CTX type, used during verification of
0030 /// a peer certificate.
0031 /**
0032  * @note The verify_context does not own the underlying X509_STORE_CTX object.
0033  */
0034 class verify_context
0035   : private noncopyable
0036 {
0037 public:
0038   /// The native handle type of the verification context.
0039   typedef X509_STORE_CTX* native_handle_type;
0040 
0041   /// Constructor.
0042   explicit verify_context(native_handle_type handle)
0043     : handle_(handle)
0044   {
0045   }
0046 
0047   /// Get the underlying implementation in the native type.
0048   /**
0049    * This function may be used to obtain the underlying implementation of the
0050    * context. This is intended to allow access to context functionality that is
0051    * not otherwise provided.
0052    */
0053   native_handle_type native_handle()
0054   {
0055     return handle_;
0056   }
0057 
0058 private:
0059   // The underlying native implementation.
0060   native_handle_type handle_;
0061 };
0062 
0063 } // namespace ssl
0064 } // namespace asio
0065 } // namespace boost
0066 
0067 #include <boost/asio/detail/pop_options.hpp>
0068 
0069 #endif // BOOST_ASIO_SSL_VERIFY_CONTEXT_HPP