diff -r 48780e181b38 -r 578be2adaf3e Symbian3/PDK/Source/GUID-A2793EFD-F765-5392-8471-C8A0C2FFC163.dita --- a/Symbian3/PDK/Source/GUID-A2793EFD-F765-5392-8471-C8A0C2FFC163.dita Tue Jul 20 12:00:49 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-A2793EFD-F765-5392-8471-C8A0C2FFC163.dita Fri Aug 13 16:47:46 2010 +0100 @@ -1,28 +1,28 @@ - - - - - -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); + + + + + +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:

  • Create a security settings object, TBTServiceSecurity. Initialise it with the service's Bluetooth protocol, its port, and a unique identifier for the service (this identifier is not related to the service class UUID).

  • Set in the TBTServiceSecurity object whether authentication, authorisation, and/or encryption are required.

  • Call RBTSecuritySettings::RegisterService() to pass the settings to the security manager.

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);
\ No newline at end of file