Symbian3/SDK/Source/GUID-39C9DD69-504A-529C-ABD3-A73DCAD3F8E9.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 21 Jan 2010 18:18:20 +0000
changeset 0 89d6a7a84779
permissions -rw-r--r--
Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-39C9DD69-504A-529C-ABD3-A73DCAD3F8E9"><title>How to connect to the security manager</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>To use the security manager, a client must:</p> <ol id="GUID-55BB4F8C-4F70-57B0-9A2B-C1E674C9E8A6"><li id="GUID-3CABDB0B-F343-5C34-9B6C-F9AAC9CB585C"><p>Create a session to the security manager, <xref href="GUID-B7CBABF9-93A1-3275-9CB0-CDF8A6606BB1.dita"><apiname>RBTMan</apiname></xref>, and open a connection.</p> </li> <li id="GUID-1A0A7EFB-40E0-577F-926E-22C4A8C38201"><p>Create a subsession to the security manager, <xref href="GUID-D536FA83-2535-3BF2-AC0D-EA0C7CA806BA.dita"><apiname>RBTSecuritySettings</apiname></xref>, and open it. A client can have multiple subsessions open if required. (Sessions and subsessions are part of Symbian OS's architecture for interprocess communication: see <xref href="GUID-D0D27AEA-FDDB-5F6F-94F6-ADDF5910DC47.dita">Client/Server Overview</xref>).</p> </li> <li id="GUID-972EB63B-4DCB-5589-8755-5C1EFC5D4977"><p>Close subsessions and sessions when they are no longer needed.</p> </li> </ol> <p><b>Example</b> </p> <p>The following example shows how to connect to the security manager:</p> <codeblock id="GUID-5BC3C01F-C320-5853-8F24-5126145B778C" xml:space="preserve">
// 1. Create and open session to the security manager
RBTMan secMan;
User::LeaveIfError(secMan.Connect());

// 2. Create and open a subsession
RBTSecuritySettings secmanSubSession;
User::LeaveIfError(secmanSubSession.Open(secMan));

...
// 3. Cleanup
secmanSubSession.Close();
secMan.Close();
</codeblock> </conbody></concept>