Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/_sec_engine_8h-source.html
changeset 1 25a17d01db0c
equal deleted inserted replaced
0:89d6a7a84779 1:25a17d01db0c
       
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
       
     2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
       
     3 <title>TB10.1 Example Applications: examples/Networking/SecureSockets/SecEngine.h Source File</title>
       
     4 <link href="doxygen.css" rel="stylesheet" type="text/css">
       
     5 <link href="tabs.css" rel="stylesheet" type="text/css">
       
     6 </head><body>
       
     7 <!-- Generated by Doxygen 1.5.3 -->
       
     8 <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>
       
     9 <a name="l00002"></a>00002 <span class="comment">// All rights reserved.</span>
       
    10 <a name="l00003"></a>00003 <span class="comment">// This component and the accompanying materials are made available</span>
       
    11 <a name="l00004"></a>00004 <span class="comment">// under the terms of "Eclipse Public License v1.0"</span>
       
    12 <a name="l00005"></a>00005 <span class="comment">// which accompanies this distribution, and is available</span>
       
    13 <a name="l00006"></a>00006 <span class="comment">// at the URL "http://www.eclipse.org/legal/epl-v10.html".</span>
       
    14 <a name="l00007"></a>00007 <span class="comment">//</span>
       
    15 <a name="l00008"></a>00008 <span class="comment">// Initial Contributors:</span>
       
    16 <a name="l00009"></a>00009 <span class="comment">// Nokia Corporation - initial contribution.</span>
       
    17 <a name="l00010"></a>00010 <span class="comment">//</span>
       
    18 <a name="l00011"></a>00011 <span class="comment">// Contributors:</span>
       
    19 <a name="l00012"></a>00012 <span class="comment">//</span>
       
    20 <a name="l00013"></a>00013 <span class="comment">// Description:</span>
       
    21 <a name="l00014"></a>00014 <span class="comment">//</span>
       
    22 <a name="l00015"></a>00015 
       
    23 <a name="l00016"></a>00016 <span class="preprocessor">#ifndef __SECENGINE_H__</span>
       
    24 <a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define __SECENGINE_H__</span>
       
    25 <a name="l00018"></a>00018 <span class="preprocessor"></span>
       
    26 <a name="l00019"></a>00019 <span class="preprocessor">#include &lt;e32cons.h&gt;</span>
       
    27 <a name="l00020"></a>00020 <span class="preprocessor">#include &lt;c32comm.h&gt;</span>
       
    28 <a name="l00021"></a>00021 <span class="preprocessor">#include &lt;in_sock.h&gt;</span>
       
    29 <a name="l00022"></a>00022 <span class="preprocessor">#include &lt;securesocket.h&gt;</span>
       
    30 <a name="l00023"></a>00023 <span class="preprocessor">#include &lt;x509cert.h&gt;</span>
       
    31 <a name="l00024"></a>00024 
       
    32 <a name="l00026"></a>00026 <span class="keyword">const</span> TInt KSettingFieldWidth = 128;
       
    33 <a name="l00027"></a>00027 
       
    34 <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>
       
    35 <a name="l00030"></a>00030         {
       
    36 <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>;
       
    37 <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>;
       
    38 <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>;
       
    39 <a name="l00037"></a>00037         };
       
    40 <a name="l00038"></a>00038 
       
    41 <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
       
    42 <a name="l00043"></a>00043         {
       
    43 <a name="l00044"></a>00044 <span class="keyword">public</span>:
       
    44 <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>();
       
    45 <a name="l00053"></a>00053         <a class="code" href="class_c_sec_engine.html#5e11af23e18320c7c781c7250a0c25b1">~CSecEngine</a>();
       
    46 <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 );
       
    47 <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 );
       
    48 <a name="l00079"></a>00079 
       
    49 <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 );
       
    50 <a name="l00086"></a>00086 
       
    51 <a name="l00092"></a>00092         TBool <a class="code" href="class_c_sec_engine.html#137260c67a287dd2519efc99df880e5c">InUse</a>();
       
    52 <a name="l00093"></a>00093 
       
    53 <a name="l00094"></a>00094 <span class="keyword">private</span>:
       
    54 <a name="l00096"></a>00096         <span class="keyword">enum</span> TStates  
       
    55 <a name="l00097"></a>00097                 {
       
    56 <a name="l00099"></a>00099                 ESocketConnected,
       
    57 <a name="l00101"></a>00101                 ESettingCiphers,
       
    58 <a name="l00103"></a>00103                 ESecureConnected,
       
    59 <a name="l00105"></a>00105                 EGetRequestSent,
       
    60 <a name="l00107"></a>00107                 EDataReceived,
       
    61 <a name="l00109"></a>00109                 EConnectionClosed
       
    62 <a name="l00110"></a>00110                 };
       
    63 <a name="l00111"></a>00111         
       
    64 <a name="l00112"></a>00112 <span class="keyword">private</span>:
       
    65 <a name="l00114"></a>00114         <a class="code" href="class_c_sec_engine.html">CSecEngine</a>();    
       
    66 <a name="l00116"></a>00116         <span class="keywordtype">void</span> ConstructL();
       
    67 <a name="l00117"></a>00117 
       
    68 <a name="l00118"></a>00118         <span class="comment">// Methods from CActive</span>
       
    69 <a name="l00120"></a>00120 <span class="comment"></span>        <span class="keywordtype">void</span> RunL();
       
    70 <a name="l00122"></a>00122         <span class="keywordtype">void</span> DoCancel();
       
    71 <a name="l00124"></a>00124         TInt RunError( TInt aError );
       
    72 <a name="l00125"></a>00125         
       
    73 <a name="l00126"></a>00126         <span class="comment">// Handle particular engine states</span>
       
    74 <a name="l00128"></a>00128 <span class="comment"></span>        <span class="keywordtype">void</span> MakeSecureConnectionL();
       
    75 <a name="l00130"></a>00130         <span class="keywordtype">void</span> MakePageRequestL();
       
    76 <a name="l00132"></a>00132         <span class="keywordtype">void</span> GetServerResponseL();
       
    77 <a name="l00134"></a>00134         <span class="keywordtype">void</span> ReadServerResponseL();
       
    78 <a name="l00136"></a>00136         <span class="keywordtype">void</span> ConnectionClosed();
       
    79 <a name="l00137"></a>00137 
       
    80 <a name="l00139"></a>00139         <span class="keywordtype">void</span> PrintCipherNameL(<span class="keyword">const</span> TDes8&amp; aBuf);
       
    81 <a name="l00141"></a>00141         <span class="keywordtype">void</span> PrintCertInfo(<span class="keyword">const</span> CX509Certificate&amp; aSource);
       
    82 <a name="l00142"></a>00142 
       
    83 <a name="l00143"></a>00143 <span class="keyword">private</span>:
       
    84 <a name="l00144"></a>00144         <span class="comment">// Sockets objects</span>
       
    85 <a name="l00146"></a>00146 <span class="comment"></span>        RSocketServ iSocketServ;
       
    86 <a name="l00148"></a>00148         RSocket iSocket;
       
    87 <a name="l00150"></a>00150         RHostResolver iHostResolver;
       
    88 <a name="l00152"></a>00152         TInetAddr iInetAddr;
       
    89 <a name="l00154"></a>00154         CSecureSocket* iTlsSocket;
       
    90 <a name="l00155"></a>00155 
       
    91 <a name="l00156"></a>00156         <span class="comment">// Connection parameters</span>
       
    92 <a name="l00157"></a>00157         <span class="keyword">const</span> <a class="code" href="struct_t_connect_settings.html">TConnectSettings</a>* iConnectSettings;
       
    93 <a name="l00158"></a>00158 
       
    94 <a name="l00159"></a>00159         <span class="comment">// Transfer buffers and counters</span>
       
    95 <a name="l00161"></a>00161 <span class="comment"></span>        TPtr8 iSndBuffer;
       
    96 <a name="l00163"></a>00163         TSockXfrLength iBytesSent;
       
    97 <a name="l00165"></a>00165         TPtr8 iRcvBuffer;
       
    98 <a name="l00167"></a>00167         TInt iTotalBytesRead;
       
    99 <a name="l00168"></a>00168 
       
   100 <a name="l00170"></a>00170         RTimer iTimer;
       
   101 <a name="l00171"></a>00171 
       
   102 <a name="l00173"></a>00173         CConsoleBase *iConsole;
       
   103 <a name="l00175"></a>00175         RFile* iOutputFile;
       
   104 <a name="l00176"></a>00176 
       
   105 <a name="l00177"></a>00177         <span class="comment">// Flags and state</span>
       
   106 <a name="l00179"></a>00179 <span class="comment"></span>        TBool           iSuccess;
       
   107 <a name="l00181"></a>00181         TBool   iFirstRunFlag;
       
   108 <a name="l00183"></a>00183         TBool   iInUse;
       
   109 <a name="l00185"></a>00185         TInt    iRunState;
       
   110 <a name="l00186"></a>00186         };
       
   111 <a name="l00187"></a>00187 
       
   112 <a name="l00188"></a>00188 <span class="preprocessor">#endif</span>
       
   113 </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;
       
   114 <a href="http://www.doxygen.org/index.html">
       
   115 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
       
   116 </body>
       
   117 </html>