Symbian3/SDK/Source/GUID-4F0C4B9D-AA42-59C4-900A-7045FEAAF2F4.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?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-4F0C4B9D-AA42-59C4-900A-7045FEAAF2F4"><title>Using security on outgoing sockets</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>For an outgoing connection, the Bluetooth stack will not, by default, enforce any particular Bluetooth security. If the remote device requires authentication/encryption to connect, then this will be handled by the stack transparently to the application. </p> <section><title>How to use security on outgoing sockets</title> <p>It may occasionally be necessary for the local application to insist on authenticating or encrypting the link. In this case, there are control operations (<codeph>ioctls</codeph>) that can be issued on a connected <xref href="GUID-D4F08503-F1EF-3531-9C3C-4AF24A6255F0.dita"><apiname>RSocket</apiname></xref> that will authenticate (<codeph>ioctl
        </codeph> <xref href="GUID-429D5401-3C12-38B8-BC41-A0917BF74EF8.dita"><apiname>KHCIAuthRequestIoctl</apiname></xref>) or encrypt (<xref href="GUID-01EFBA4B-E35C-3EFE-9678-60EC887CD93D.dita"><apiname>KHCIEncryptIoctl</apiname></xref>) the link. </p> <p><b>Issuing Authentication Requests </b> </p> <p>The following example shows the authentication request <codeph>ioctl</codeph> being issued. </p> <codeblock id="GUID-3C82D4B6-0D15-537B-A4C4-F0666BF7DA5A" xml:space="preserve">// Assume you have an opened L2CAP RSocket object, socket
socket.Ioctl(KHCIAuthRequestIoctl, status, NULL, KSolBtHCI);
User::WaitForRequest(status);
if (status==KErrNone)
    {
    \\ Success...</codeblock> </section> <section><title>Where Next?</title> <p>This tutorial set takes you through all the steps involved in setting up and communicating over a Bluetooth connection. </p> <ul><li id="GUID-3816B7B8-8792-55B0-BE28-AA4DFE3B3E24"><p> <xref href="GUID-301488F8-B6D8-569A-B05E-19B740FE4C00.dita">Selecting a Remote Device</xref> </p> </li> <li id="GUID-632D24D8-7B74-5AAA-92B3-EB3857B60D44"><p> <xref href="GUID-CED041C8-D68D-55D1-957E-1A48EEFFF851.dita">Inquiring About Remote Devices</xref>  </p> </li> <li id="GUID-65DA0494-5ACC-5613-B818-8A0CA1CC8123"><p> <xref href="GUID-A13494B9-C1E4-506A-B236-8AE0A6D6D557.dita">Inquiring About Services on a Remote Device</xref> </p> </li> <li id="GUID-606F93E4-87C9-5B52-B683-4CBB88270BB4"><p> <xref href="GUID-A24D2CEF-88C9-5C63-A14D-85EFFBEF3C92.dita">Connecting and Transferring Data to a Remote Device</xref> </p> </li> <li id="GUID-B429E0B8-3D35-539B-B88F-CC841F94FF4F"><p> <b>Using security on outgoing sockets</b> - This document </p> </li> </ul> </section> </conbody></concept>