ssl_socket.h

00001 /*
00002  * ssl_socket.h
00003  * This file is part of dbPager Classes Library (DCL)
00004  *
00005  * Copyright (c) 2009 Dennis Prochko <wolfsoft@mail.ru>
00006  *
00007  * DCL is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation version 3.
00010  *
00011  * DCL is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with DCL; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor,
00019  * Boston, MA  02110-1301  USA
00020  */
00021 
00022 #ifndef _SSL_SOCKET_H_
00023 #define _SSL_SOCKET_H_
00024 
00025 #include <vector>
00026 #include <string>
00027 
00028 #include <dcl/socket.h>
00029 
00030 namespace dbp {
00031 
00032 class ssl_socket_impl;
00033 
00035 
00038 class ssl_socket: public socket {
00039 public:
00041         ssl_socket();
00043         ssl_socket(const socket &src);
00045         ssl_socket& operator=(const ssl_socket &src);
00047         virtual ~ssl_socket();
00049         virtual int handle() const;
00051         virtual int read(int bytes_to_read, char *buffer);
00053         virtual int write(int bytes_to_write, const char *buffer);
00055         virtual void shutdown();
00057         void load_certificates(
00058           const std::string &ca,
00059           const std::string &cert, const std::string &key,
00060           const std::string &crl);
00061 private:
00062         ssl_socket_impl *pimpl;
00063 };
00064 
00065 }
00066 
00067 #endif /*_SSL_SOCKET_H_*/
00068 

 
Support This Project
SourceForge.net Logo