Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



How to set service security requirements

The security requirements that can be set for a service are simple: you can only specify whether authentication, authorisation, and/or encryption are required or not. You cannot, for example, set the security algorithms used: these are the same for all Bluetooth devices.

To set security requirements, take the following steps:

Example

The following example sets that authentication, authorisation, and encryption are required for a service.

// Assumes secmanSubSession is an open subsession, and channel
// is the port on which an RFCOMM service is running

// 1. Create security settings object
TUid serviceUID;
serviceUID.iUid = 0X10008AD0;
TBTServiceSecurity secSettings(serviceUID, KSolBtRFCOMM, channel);

// 2. Set the security options
secSettings.SetAuthentication(ETrue);
secSettings.SetAuthorisation(ETrue);
secSettings.SetEncryption(ETrue);

// 3. Register the service
TRequestStatus status;
secmanSubSession.RegisterService(secSettings,status);
User::WaitForRequest(status);