⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sslsocket_8h-source.html

📁 LINUX下发送邮件的库,测试很好用,有各种发送测试的例子
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>sslsocket.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.15 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center>
<hr><h1>sslsocket.h</h1><div class="fragment"><pre>00001 <font class="comment">/*************************************************************************</font>
00002 <font class="comment"> *                                                                       *</font>
00003 <font class="comment"> * This program is free software; you can redistribute it and/or modify  *</font>
00004 <font class="comment"> * it under the terms of the GNU General Public License as published by  *</font>
00005 <font class="comment"> * the Free Software Foundation; either version 2 of the License, or     *</font>
00006 <font class="comment"> * (at your option) any later version.                                   *</font>
00007 <font class="comment"> *                                                                       *</font>
00008 <font class="comment"> *************************************************************************/</font>
00009 
00010 <font class="preprocessor">#ifndef _SSLSOCKET_H__</font>
00011 <font class="preprocessor"></font><font class="preprocessor">#define _SSLSOCKET_H__</font>
00012 <font class="preprocessor"></font>
00013 <font class="preprocessor">#include "global.h"</font>
00014 <font class="preprocessor">#include "socket.h"</font>
00015 <font class="preprocessor">#include "exception.h"</font>
00016 <font class="preprocessor">#include "logger.h"</font>
00017 <font class="preprocessor">#include "i18n.h"</font>
00018 <font class="preprocessor">#include "socket.h"</font>
00019 <font class="preprocessor">#include &lt;strings.h&gt;</font>
00020 <font class="preprocessor">#include &lt;unistd.h&gt;</font>
00021 <font class="preprocessor">#include &lt;arpa/inet.h&gt;</font>
00022 <font class="preprocessor">#include &lt;netdb.h&gt;</font>
00023 <font class="preprocessor">#include &lt;sys/socket.h&gt;</font>
00024 <font class="preprocessor">#include &lt;netinet/in.h&gt;</font>
00025 <font class="preprocessor">#include &lt;errno.h&gt;</font>
00026 <font class="preprocessor">#include &lt;string&gt;</font>
00027 <font class="preprocessor">#include &lt;openssl/crypto.h&gt;</font>
00028 <font class="preprocessor">#include &lt;openssl/x509.h&gt;</font>
00029 <font class="preprocessor">#include &lt;openssl/pem.h&gt;</font>
00030 <font class="preprocessor">#include &lt;openssl/ssl.h&gt;</font>
00031 <font class="preprocessor">#include &lt;openssl/err.h&gt;</font>
00032 
00033 <font class="keyword">using</font> <font class="keyword">namespace </font>std;
00034 
<a name="l00045"></a><a class="code" href="classSSLSocket.html">00045</a> <font class="keyword">class </font><a class="code" href="classSSLSocket.html">SSLSocket</a> : <font class="keyword">public</font> <a class="code" href="classSocket.html">Socket</a>
00046 {
00047         <font class="keyword">public</font>:    
00053                 <a class="code" href="classSSLSocket.html#a0">SSLSocket</a> (<font class="keyword">const</font> string &amp;<a class="code" href="classSocket.html#n0">host</a>);
00054 
00061                 <a class="code" href="classSSLSocket.html#a0">SSLSocket</a> (<font class="keyword">const</font> string &amp;<a class="code" href="classSocket.html#n0">host</a>, <font class="keywordtype">int</font> fd);
00062 
<a name="l00068"></a><a class="code" href="classSSLSocket.html#s2">00068</a>                 <font class="keyword">enum</font> <a class="code" href="classSSLSocket.html#s2">SSL_OPTS</a> { VERIFY_PEER, VERIFY_NONE };
00069 
00073                 <font class="keyword">virtual</font> <a class="code" href="classSSLSocket.html#a2">~SSLSocket</a> ();
00074 
00087                 string <a class="code" href="classSSLSocket.html#a3">readSocket</a> ();
00088 
00102                 <font class="keywordtype">void</font> <a class="code" href="classSSLSocket.html#a4">writeSocket</a> (<font class="keyword">const</font> string &amp;data);
00103 
00109                 <font class="keywordtype">void</font> <a class="code" href="classSSLSocket.html#a5">setSSLOpts</a> (<a class="code" href="classSSLSocket.html#s2">SSL_OPTS</a> opts);
00110 
00148                 <font class="keywordtype">void</font> <a class="code" href="classSSLSocket.html#a6">setVerifyLocations</a> (<font class="keyword">const</font> string &amp;<a class="code" href="classSSLSocket.html#n4">ca_file</a>, <font class="keyword">const</font> string &amp;<a class="code" href="classSSLSocket.html#n5">ca_dir</a>);
00149 
00158                 <font class="keywordtype">void</font> <a class="code" href="classSSLSocket.html#a7">negotiate</a> ();
00159 
00160         <font class="keyword">protected</font>:
00161 
<a name="l00165"></a><a class="code" href="classSSLSocket.html#n0">00165</a>                 SSL_CTX * <a class="code" href="classSSLSocket.html#n0">ctx</a>;
00166 
<a name="l00170"></a><a class="code" href="classSSLSocket.html#n1">00170</a>                 SSL * <a class="code" href="classSSLSocket.html#n1">ssl</a>;
00171 
<a name="l00176"></a><a class="code" href="classSSLSocket.html#n2">00176</a>                 <font class="keywordtype">bool</font> <a class="code" href="classSSLSocket.html#n2">negotiated</a>;
00177 
<a name="l00181"></a><a class="code" href="classSSLSocket.html#n3">00181</a>                 <font class="keywordtype">int</font> <a class="code" href="classSSLSocket.html#n3">verify</a>;
00182 
<a name="l00186"></a><a class="code" href="classSSLSocket.html#n4">00186</a>                 string <a class="code" href="classSSLSocket.html#n4">ca_file</a>;
00187 
<a name="l00192"></a><a class="code" href="classSSLSocket.html#n5">00192</a>                 string <a class="code" href="classSSLSocket.html#n5">ca_dir</a>;
00193 
00197                 <font class="keywordtype">void</font> <a class="code" href="classSSLSocket.html#b0">dumpSSLInfo</a> ();
00198 
00208                 string <a class="code" href="classSSLSocket.html#b1">ssl_readSocket</a> ();
00209 
00220                 <font class="keywordtype">void</font> <a class="code" href="classSSLSocket.html#b2">ssl_writeSocket</a> (<font class="keyword">const</font> string &amp;data);
00221 
00230                 string <a class="code" href="classSSLSocket.html#b3">ssl_error</a> (<font class="keywordtype">int</font> ret = 65536);
00231 
00238                 <font class="keywordtype">int</font> <a class="code" href="classSSLSocket.html#b4">ssl_read</a> (SSL * <a class="code" href="classSSLSocket.html#n1">ssl</a>, <font class="keywordtype">void</font> * buf, <font class="keywordtype">int</font> num);
00239 
00246                 <font class="keywordtype">int</font> <a class="code" href="classSSLSocket.html#b5">ssl_write</a> (SSL * <a class="code" href="classSSLSocket.html#n1">ssl</a>, <font class="keyword">const</font> <font class="keywordtype">void</font> * buf, <font class="keywordtype">int</font> num);
00247 
00254                 <font class="keywordtype">int</font> <a class="code" href="classSSLSocket.html#b6">ssl_connect</a> (SSL * <a class="code" href="classSSLSocket.html#n1">ssl</a>);
00255 };
00256 
00257 <font class="preprocessor">#endif</font>
</pre></div><hr><address align="right"><small>Generated on Tue Jan 28 17:09:58 2003 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.15 </small></address>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -