Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/_sec_engine_8h-source.html
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Tue, 30 Mar 2010 11:42:04 +0100
changeset 4 4816d766a08a
parent 1 25a17d01db0c
permissions -rw-r--r--
Week 12 contribution of SDK documentation_content. See release notes for details. Fixes Bug 1892, Bug 1522, Bug 1520, Bug 394, Bug 1319, Bug 344, Bug 1897

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>TB10.1 Example Applications: examples/Networking/SecureSockets/SecEngine.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.3 -->
<h1>examples/Networking/SecureSockets/SecEngine.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).</span>
<a name="l00002"></a>00002 <span class="comment">// All rights reserved.</span>
<a name="l00003"></a>00003 <span class="comment">// This component and the accompanying materials are made available</span>
<a name="l00004"></a>00004 <span class="comment">// under the terms of "Eclipse Public License v1.0"</span>
<a name="l00005"></a>00005 <span class="comment">// which accompanies this distribution, and is available</span>
<a name="l00006"></a>00006 <span class="comment">// at the URL "http://www.eclipse.org/legal/epl-v10.html".</span>
<a name="l00007"></a>00007 <span class="comment">//</span>
<a name="l00008"></a>00008 <span class="comment">// Initial Contributors:</span>
<a name="l00009"></a>00009 <span class="comment">// Nokia Corporation - initial contribution.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// Contributors:</span>
<a name="l00012"></a>00012 <span class="comment">//</span>
<a name="l00013"></a>00013 <span class="comment">// Description:</span>
<a name="l00014"></a>00014 <span class="comment">//</span>
<a name="l00015"></a>00015 
<a name="l00016"></a>00016 <span class="preprocessor">#ifndef __SECENGINE_H__</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define __SECENGINE_H__</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;e32cons.h&gt;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;c32comm.h&gt;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;in_sock.h&gt;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;securesocket.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;x509cert.h&gt;</span>
<a name="l00024"></a>00024 
<a name="l00026"></a>00026 <span class="keyword">const</span> TInt KSettingFieldWidth = 128;
<a name="l00027"></a>00027 
<a name="l00029"></a><a class="code" href="struct_t_connect_settings.html">00029</a> <span class="keyword">struct </span><a class="code" href="struct_t_connect_settings.html">TConnectSettings</a>
<a name="l00030"></a>00030         {
<a name="l00032"></a><a class="code" href="struct_t_connect_settings.html#e6d2f1669fc1ac25338d5bf103f85bd7">00032</a>         TBuf&lt;KSettingFieldWidth&gt; <a class="code" href="struct_t_connect_settings.html#e6d2f1669fc1ac25338d5bf103f85bd7">iAddress</a>;
<a name="l00034"></a><a class="code" href="struct_t_connect_settings.html#10921328934dd9ab92432ecfa3471c4e">00034</a>         TInt <a class="code" href="struct_t_connect_settings.html#10921328934dd9ab92432ecfa3471c4e">iPortNum</a>;
<a name="l00036"></a><a class="code" href="struct_t_connect_settings.html#bcf1a6c3491df55d9bfa71af6b920754">00036</a>         TBuf8&lt;KSettingFieldWidth&gt; <a class="code" href="struct_t_connect_settings.html#bcf1a6c3491df55d9bfa71af6b920754">iPage</a>;
<a name="l00037"></a>00037         };
<a name="l00038"></a>00038 
<a name="l00042"></a><a class="code" href="class_c_sec_engine.html">00042</a> <span class="keyword">class </span><a class="code" href="class_c_sec_engine.html">CSecEngine</a> : <span class="keyword">public</span> CActive
<a name="l00043"></a>00043         {
<a name="l00044"></a>00044 <span class="keyword">public</span>:
<a name="l00049"></a>00049         <span class="keyword">static</span> <a class="code" href="class_c_sec_engine.html">CSecEngine</a> *<a class="code" href="class_c_sec_engine.html#28e68fc7a2fbb14f316dd9c1905d117c">NewL</a>();
<a name="l00053"></a>00053         <a class="code" href="class_c_sec_engine.html#5e11af23e18320c7c781c7250a0c25b1">~CSecEngine</a>();
<a name="l00072"></a>00072         <span class="keywordtype">void</span> <a class="code" href="class_c_sec_engine.html#b13ef6e8b9c8b4de8c3e6748625c4bd5">ConnectL</a>( <span class="keyword">const</span> <a class="code" href="struct_t_connect_settings.html">TConnectSettings</a>&amp; aConnectSettings );
<a name="l00078"></a>00078         <span class="keywordtype">void</span> <a class="code" href="class_c_sec_engine.html#b1a5a2132c12cfc0d9a5fed49cb739c2">SetConsole</a>( CConsoleBase&amp; aConsole );
<a name="l00079"></a>00079 
<a name="l00085"></a>00085         <span class="keywordtype">void</span> <a class="code" href="class_c_sec_engine.html#2d03d9e8d0822c833de323b54eb20c62">SetOutputFile</a>( RFile&amp; aOutputFile );
<a name="l00086"></a>00086 
<a name="l00092"></a>00092         TBool <a class="code" href="class_c_sec_engine.html#137260c67a287dd2519efc99df880e5c">InUse</a>();
<a name="l00093"></a>00093 
<a name="l00094"></a>00094 <span class="keyword">private</span>:
<a name="l00096"></a>00096         <span class="keyword">enum</span> TStates  
<a name="l00097"></a>00097                 {
<a name="l00099"></a>00099                 ESocketConnected,
<a name="l00101"></a>00101                 ESettingCiphers,
<a name="l00103"></a>00103                 ESecureConnected,
<a name="l00105"></a>00105                 EGetRequestSent,
<a name="l00107"></a>00107                 EDataReceived,
<a name="l00109"></a>00109                 EConnectionClosed
<a name="l00110"></a>00110                 };
<a name="l00111"></a>00111         
<a name="l00112"></a>00112 <span class="keyword">private</span>:
<a name="l00114"></a>00114         <a class="code" href="class_c_sec_engine.html">CSecEngine</a>();    
<a name="l00116"></a>00116         <span class="keywordtype">void</span> ConstructL();
<a name="l00117"></a>00117 
<a name="l00118"></a>00118         <span class="comment">// Methods from CActive</span>
<a name="l00120"></a>00120 <span class="comment"></span>        <span class="keywordtype">void</span> RunL();
<a name="l00122"></a>00122         <span class="keywordtype">void</span> DoCancel();
<a name="l00124"></a>00124         TInt RunError( TInt aError );
<a name="l00125"></a>00125         
<a name="l00126"></a>00126         <span class="comment">// Handle particular engine states</span>
<a name="l00128"></a>00128 <span class="comment"></span>        <span class="keywordtype">void</span> MakeSecureConnectionL();
<a name="l00130"></a>00130         <span class="keywordtype">void</span> MakePageRequestL();
<a name="l00132"></a>00132         <span class="keywordtype">void</span> GetServerResponseL();
<a name="l00134"></a>00134         <span class="keywordtype">void</span> ReadServerResponseL();
<a name="l00136"></a>00136         <span class="keywordtype">void</span> ConnectionClosed();
<a name="l00137"></a>00137 
<a name="l00139"></a>00139         <span class="keywordtype">void</span> PrintCipherNameL(<span class="keyword">const</span> TDes8&amp; aBuf);
<a name="l00141"></a>00141         <span class="keywordtype">void</span> PrintCertInfo(<span class="keyword">const</span> CX509Certificate&amp; aSource);
<a name="l00142"></a>00142 
<a name="l00143"></a>00143 <span class="keyword">private</span>:
<a name="l00144"></a>00144         <span class="comment">// Sockets objects</span>
<a name="l00146"></a>00146 <span class="comment"></span>        RSocketServ iSocketServ;
<a name="l00148"></a>00148         RSocket iSocket;
<a name="l00150"></a>00150         RHostResolver iHostResolver;
<a name="l00152"></a>00152         TInetAddr iInetAddr;
<a name="l00154"></a>00154         CSecureSocket* iTlsSocket;
<a name="l00155"></a>00155 
<a name="l00156"></a>00156         <span class="comment">// Connection parameters</span>
<a name="l00157"></a>00157         <span class="keyword">const</span> <a class="code" href="struct_t_connect_settings.html">TConnectSettings</a>* iConnectSettings;
<a name="l00158"></a>00158 
<a name="l00159"></a>00159         <span class="comment">// Transfer buffers and counters</span>
<a name="l00161"></a>00161 <span class="comment"></span>        TPtr8 iSndBuffer;
<a name="l00163"></a>00163         TSockXfrLength iBytesSent;
<a name="l00165"></a>00165         TPtr8 iRcvBuffer;
<a name="l00167"></a>00167         TInt iTotalBytesRead;
<a name="l00168"></a>00168 
<a name="l00170"></a>00170         RTimer iTimer;
<a name="l00171"></a>00171 
<a name="l00173"></a>00173         CConsoleBase *iConsole;
<a name="l00175"></a>00175         RFile* iOutputFile;
<a name="l00176"></a>00176 
<a name="l00177"></a>00177         <span class="comment">// Flags and state</span>
<a name="l00179"></a>00179 <span class="comment"></span>        TBool           iSuccess;
<a name="l00181"></a>00181         TBool   iFirstRunFlag;
<a name="l00183"></a>00183         TBool   iInUse;
<a name="l00185"></a>00185         TInt    iRunState;
<a name="l00186"></a>00186         };
<a name="l00187"></a>00187 
<a name="l00188"></a>00188 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 21 10:33:00 2010 for TB10.1 Example Applications by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>