📄 pssl_8h-source.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>pssl.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>pssl.h</h1><a href="pssl_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * pssl.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * Secure Sockets Layer channel interface class.</span>00005 <span class="comment"> *</span>00006 <span class="comment"> * Portable Windows Library</span>00007 <span class="comment"> *</span>00008 <span class="comment"> * Copyright (c) 1993-2002 Equivalence Pty. Ltd.</span>00009 <span class="comment"> *</span>00010 <span class="comment"> * The contents of this file are subject to the Mozilla Public License</span>00011 <span class="comment"> * Version 1.0 (the "License"); you may not use this file except in</span>00012 <span class="comment"> * compliance with the License. You may obtain a copy of the License at</span>00013 <span class="comment"> * http://www.mozilla.org/MPL/</span>00014 <span class="comment"> *</span>00015 <span class="comment"> * Software distributed under the License is distributed on an "AS IS"</span>00016 <span class="comment"> * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See</span>00017 <span class="comment"> * the License for the specific language governing rights and limitations</span>00018 <span class="comment"> * under the License.</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * The Original Code is Portable Windows Library.</span>00021 <span class="comment"> *</span>00022 <span class="comment"> * The Initial Developer of the Original Code is Equivalence Pty. Ltd.</span>00023 <span class="comment"> *</span>00024 <span class="comment"> * Contributor(s): ______________________________________.</span>00025 <span class="comment"> *</span>00026 <span class="comment"> * $Log: pssl.h,v $</span>00027 <span class="comment"> * Revision 1.19 2002/11/06 22:47:24 robertj</span>00028 <span class="comment"> * Fixed header comment (copyright etc)</span>00029 <span class="comment"> *</span>00030 <span class="comment"> * Revision 1.18 2002/09/16 01:08:59 robertj</span>00031 <span class="comment"> * Added #define so can select if #pragma interface/implementation is used on</span>00032 <span class="comment"> * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.</span>00033 <span class="comment"> *</span>00034 <span class="comment"> * Revision 1.17 2002/03/28 07:26:36 robertj</span>00035 <span class="comment"> * Added Diffie-Hellman parameters wrapper class.</span>00036 <span class="comment"> *</span>00037 <span class="comment"> * Revision 1.16 2001/12/13 09:15:20 robertj</span>00038 <span class="comment"> * Added function to get private key as ray DER binary data or as base64 string.</span>00039 <span class="comment"> *</span>00040 <span class="comment"> * Revision 1.15 2001/12/06 04:06:03 robertj</span>00041 <span class="comment"> * Removed "Win32 SSL xxx" build configurations in favour of system</span>00042 <span class="comment"> * environment variables to select optional libraries.</span>00043 <span class="comment"> *</span>00044 <span class="comment"> * Revision 1.14 2001/10/31 01:30:40 robertj</span>00045 <span class="comment"> * Added enhancements for saving/loading/creating certificates and keys.</span>00046 <span class="comment"> *</span>00047 <span class="comment"> * Revision 1.13 2001/09/10 02:51:22 robertj</span>00048 <span class="comment"> * Major change to fix problem with error codes being corrupted in a</span>00049 <span class="comment"> * PChannel when have simultaneous reads and writes in threads.</span>00050 <span class="comment"> *</span>00051 <span class="comment"> * Revision 1.12 2001/06/01 00:53:59 robertj</span>00052 <span class="comment"> * Added certificate constructor that takes a PBYTEArray</span>00053 <span class="comment"> *</span>00054 <span class="comment"> * Revision 1.11 2001/05/16 06:02:05 craigs</span>00055 <span class="comment"> * Changed to allow detection of non-SSL connection to SecureHTTPServiceProcess</span>00056 <span class="comment"> *</span>00057 <span class="comment"> * Revision 1.10 2000/11/14 08:33:16 robertj</span>00058 <span class="comment"> * Added certificate and private key classes.</span>00059 <span class="comment"> *</span>00060 <span class="comment"> * Revision 1.9 2000/08/25 08:11:02 robertj</span>00061 <span class="comment"> * Fixed OpenSSL support so can operate as a server channel.</span>00062 <span class="comment"> *</span>00063 <span class="comment"> * Revision 1.8 2000/08/04 12:52:18 robertj</span>00064 <span class="comment"> * SSL changes, added error functions, removed need to have openssl include directory in app.</span>00065 <span class="comment"> *</span>00066 <span class="comment"> * Revision 1.7 2000/01/10 02:23:18 craigs</span>00067 <span class="comment"> * Update for new OpenSSL</span>00068 <span class="comment"> *</span>00069 <span class="comment"> * Revision 1.6 1999/02/16 08:07:10 robertj</span>00070 <span class="comment"> * MSVC 6.0 compatibility changes.</span>00071 <span class="comment"> *</span>00072 <span class="comment"> * Revision 1.5 1998/12/04 13:01:51 craigs</span>00073 <span class="comment"> * Changed for SSLeay 0.9</span>00074 <span class="comment"> *</span>00075 <span class="comment"> * Revision 1.4 1998/09/23 06:19:50 robertj</span>00076 <span class="comment"> * Added open source copyright license.</span>00077 <span class="comment"> *</span>00078 <span class="comment"> * Revision 1.3 1997/05/04 02:49:52 craigs</span>00079 <span class="comment"> * Added support for client and server certificates</span>00080 <span class="comment"> *</span>00081 <span class="comment"> * Revision 1.1 1996/11/15 07:37:48 craigs</span>00082 <span class="comment"> * Initial revision</span>00083 <span class="comment"> *</span>00084 <span class="comment"> */</span>00085 00086 <span class="preprocessor">#ifndef _PSSL_H</span>00087 <span class="preprocessor"></span><span class="preprocessor">#define _PSSL_H</span>00088 <span class="preprocessor"></span>00089 <span class="preprocessor">#ifdef P_USE_PRAGMA</span>00090 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span>00091 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00092 <span class="preprocessor"></span>00093 <span class="preprocessor">#include <<a class="code" href="sockets_8h.html">ptlib/sockets.h</a>></span>00094 00095 00096 <span class="keyword">struct </span>ssl_st;00097 <span class="keyword">struct </span>ssl_ctx_st;00098 <span class="keyword">struct </span>x509_st;00099 <span class="keyword">struct </span>evp_pkey_st;00100 <span class="keyword">struct </span>dh_st;00101 <a name="l00102"></a><a class="code" href="pssl_8h.html#a3">00102</a> <span class="keyword">enum</span> <a class="code" href="pssl_8h.html#a3">PSSLFileTypes</a> {00103 <a class="code" href="pssl_8h.html#a3a0">PSSLFileTypePEM</a>,00104 <a class="code" href="pssl_8h.html#a3a1">PSSLFileTypeASN1</a>,00105 <a class="code" href="pssl_8h.html#a3a2">PSSLFileTypeDEFAULT</a>00106 };00107 00108 <a name="l00113"></a><a class="code" href="classPSSLPrivateKey.html">00113</a> <span class="keyword">class </span><a class="code" href="classPSSLPrivateKey.html">PSSLPrivateKey</a> : <span class="keyword">public</span> <a class="code" href="classPObject.html">PObject</a>00114 {00115 <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPSSLPrivateKey.html">PSSLPrivateKey</a>, <a class="code" href="classPObject.html">PObject</a>);00116 <span class="keyword">public</span>:00119 <a class="code" href="classPSSLPrivateKey.html#a0">PSSLPrivateKey</a>();00120 00123 <a class="code" href="classPSSLPrivateKey.html#a0">PSSLPrivateKey</a>(00124 <span class="keywordtype">unsigned</span> modulus, 00125 <span class="keywordtype">void</span> (*callback)(<span class="keywordtype">int</span>,<span class="keywordtype">int</span>,<span class="keywordtype">void</span> *) = NULL, 00126 <span class="keywordtype">void</span> *cb_arg = NULL 00127 );00128 00134 <a class="code" href="classPSSLPrivateKey.html#a0">PSSLPrivateKey</a>(00135 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & keyFile, 00136 <a class="code" href="pssl_8h.html#a3">PSSLFileTypes</a> fileType = <a class="code" href="pssl_8h.html#a3a2">PSSLFileTypeDEFAULT</a> 00137 );00138 00141 <a class="code" href="classPSSLPrivateKey.html#a0">PSSLPrivateKey</a>(00142 <span class="keyword">const</span> BYTE * keyData, 00143 PINDEX keySize 00144 );00145 00148 <a class="code" href="classPSSLPrivateKey.html#a0">PSSLPrivateKey</a>(00149 <span class="keyword">const</span> <a class="code" href="classPBYTEArray.html">PBYTEArray</a> & keyData 00150 );00151 00154 <a class="code" href="classPSSLPrivateKey.html#a0">PSSLPrivateKey</a>(00155 <span class="keyword">const</span> <a class="code" href="classPSSLPrivateKey.html">PSSLPrivateKey</a> & privKey00156 );00157 00160 <a class="code" href="classPSSLPrivateKey.html">PSSLPrivateKey</a> & <a class="code" href="classPSSLPrivateKey.html#a6">operator=</a>(00161 <span class="keyword">const</span> <a class="code" href="classPSSLPrivateKey.html">PSSLPrivateKey</a> & privKay00162 );00163 00166 <a class="code" href="classPSSLPrivateKey.html#a7">~PSSLPrivateKey</a>();00167 <a name="l00170"></a><a class="code" href="classPSSLPrivateKey.html#a8">00170</a> <a class="code" href="classPSSLPrivateKey.html#a8">operator evp_pkey_st *</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPSSLPrivateKey.html#n0">key</a>; }00171 00174 BOOL <a class="code" href="classPSSLPrivateKey.html#a9">Create</a>(00175 <span class="keywordtype">unsigned</span> modulus, 00176 <span class="keywordtype">void</span> (*callback)(<span class="keywordtype">int</span>,<span class="keywordtype">int</span>,<span class="keywordtype">void</span> *) = NULL, 00177 <span class="keywordtype">void</span> *cb_arg = NULL 00178 );00179 00182 <a class="code" href="classPBYTEArray.html">PBYTEArray</a> <a class="code" href="classPSSLPrivateKey.html#a10">GetData</a>() <span class="keyword">const</span>;00183 00186 <a class="code" href="classPString.html">PString</a> <a class="code" href="classPSSLPrivateKey.html#a11">AsString</a>() <span class="keyword">const</span>;00187 00193 BOOL <a class="code" href="classPSSLPrivateKey.html#a12">Load</a>(00194 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & keyFile, 00195 <a class="code" href="pssl_8h.html#a3">PSSLFileTypes</a> fileType = <a class="code" href="pssl_8h.html#a3a2">PSSLFileTypeDEFAULT</a> 00196 );00197 00203 BOOL <a class="code" href="classPSSLPrivateKey.html#a13">Save</a>(00204 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & keyFile, 00205 BOOL append = FALSE, 00206 <a class="code" href="pssl_8h.html#a3">PSSLFileTypes</a> fileType = <a class="code" href="pssl_8h.html#a3a2">PSSLFileTypeDEFAULT</a> 00207 );00208 00209 00210 <span class="keyword">protected</span>:<a name="l00211"></a><a class="code" href="classPSSLPrivateKey.html#n0">00211</a> evp_pkey_st * <a class="code" href="classPSSLPrivateKey.html#n0">key</a>;00212 };00213 00214 <a name="l00219"></a><a class="code" href="classPSSLCertificate.html">00219</a> <span class="keyword">class </span><a class="code" href="classPSSLCertificate.html">PSSLCertificate</a> : <span class="keyword">public</span> <a class="code" href="classPObject.html">PObject</a>00220 {00221 <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPSSLCertificate.html">PSSLCertificate</a>, <a class="code" href="classPObject.html">PObject</a>);00222 <span class="keyword">public</span>:00225 <a class="code" href="classPSSLCertificate.html#a0">PSSLCertificate</a>();00226 00232 <a class="code" href="classPSSLCertificate.html#a0">PSSLCertificate</a>(00233 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & certFile, 00234 <a class="code" href="pssl_8h.html#a3">PSSLFileTypes</a> fileType = <a class="code" href="pssl_8h.html#a3a2">PSSLFileTypeDEFAULT</a> 00235 );00236 00239 <a class="code" href="classPSSLCertificate.html#a0">PSSLCertificate</a>(00240 <span class="keyword">const</span> BYTE * certData, 00241 PINDEX certSize 00242 );00243 00246 <a class="code" href="classPSSLCertificate.html#a0">PSSLCertificate</a>(00247 <span class="keyword">const</span> <a class="code" href="classPBYTEArray.html">PBYTEArray</a> & certData 00248 );00249 00252 <a class="code" href="classPSSLCertificate.html#a0">PSSLCertificate</a>(00253 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & certString 00254 );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -