Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:01

0001 //
0002 // ssl/detail/verify_callback.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_DETAIL_VERIFY_CALLBACK_HPP
0012 #define BOOST_ASIO_SSL_DETAIL_VERIFY_CALLBACK_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/ssl/verify_context.hpp>
0021 
0022 #include <boost/asio/detail/push_options.hpp>
0023 
0024 namespace boost {
0025 namespace asio {
0026 namespace ssl {
0027 namespace detail {
0028 
0029 class verify_callback_base
0030 {
0031 public:
0032   virtual ~verify_callback_base()
0033   {
0034   }
0035 
0036   virtual bool call(bool preverified, verify_context& ctx) = 0;
0037 };
0038 
0039 template <typename VerifyCallback>
0040 class verify_callback : public verify_callback_base
0041 {
0042 public:
0043   explicit verify_callback(VerifyCallback callback)
0044     : callback_(callback)
0045   {
0046   }
0047 
0048   virtual bool call(bool preverified, verify_context& ctx)
0049   {
0050     return callback_(preverified, ctx);
0051   }
0052 
0053 private:
0054   VerifyCallback callback_;
0055 };
0056 
0057 } // namespace detail
0058 } // namespace ssl
0059 } // namespace asio
0060 } // namespace boost
0061 
0062 #include <boost/asio/detail/pop_options.hpp>
0063 
0064 #endif // BOOST_ASIO_SSL_DETAIL_VERIFY_CALLBACK_HPP