class TBTServiceSecurity |
The security settings of a bluetooth service.
Contains information regarding the service UID and the access requirements.
Public Member Functions | |
---|---|
TBTServiceSecurity (const TBTServiceSecurity &) | |
TBTServiceSecurity () | |
IMPORT_C TBool | AuthenticationRequired () |
IMPORT_C TBool | AuthorisationRequired () |
IMPORT_C TBool | Denied () |
IMPORT_C TBool | EncryptionRequired () |
IMPORT_C TBluetoothMitmProtection | MitmProtection () |
IMPORT_C TUint | PasskeyMinLength () |
IMPORT_C void | SetAuthentication ( TBool ) |
IMPORT_C void | SetAuthentication ( TBluetoothMitmProtection ) |
IMPORT_C void | SetAuthorisation ( TBool ) |
IMPORT_C void | SetDenied ( TBool ) |
IMPORT_C void | SetEncryption ( TBool ) |
IMPORT_C TInt | SetPasskeyMinLength ( TUint ) |
IMPORT_C void | SetUid ( TUid ) |
IMPORT_C TUid | Uid () |
Private Attributes | |
---|---|
TBTAccessRequirements | iSecurityRequirements |
TUid | iUid |
IMPORT_C | TBTServiceSecurity | ( | const TBTServiceSecurity & | aService | ) |
Copy constructor
const TBTServiceSecurity & aService |
IMPORT_C | TBTServiceSecurity | ( | ) |
Default constructor. Sets all member data to 0.
IMPORT_C TBool | AuthenticationRequired | ( | ) | const |
Getter - return whether authentication is required for this service. The TBTServiceSecurity::MitmProtection function should be used instead.
IMPORT_C TBool | AuthorisationRequired | ( | ) | const |
Getter - return whether authorisation is required for this service
This function is only appropriate for when the Bluetooth v2.0 and earlier authentication specification function is used. Once migrated to the new MITM level setting this function will not return a useful result, the MitmProtection function should be used instead.
IMPORT_C TBool | EncryptionRequired | ( | ) | const |
Getter - return whether encryption is required for this service.
IMPORT_C TBluetoothMitmProtection | MitmProtection | ( | ) | const |
Getter - return the level of Man-in-the-middle protection required this service.
IMPORT_C TUint | PasskeyMinLength | ( | ) | const |
Getter - return minimal passkey length requirement
IMPORT_C void | SetAuthentication | ( | TBool | aPreference | ) |
Sets whether or not any connections to this service need to be authenticated.
Authentication involves the comparison of a stored link key. If no link key has been generated and stored (e.g. the remote device has never been authenticated before) then the user will be asked to enter a pin code (a process known as pairing). If authentication fails, the connection will not be permitted.
For Bluetooth v2.1 and onward this has slightly changed in that pin code entry is not neccessary to generate a link key. Because of this, this API has been deprecated, users of this API are encouraged to migrate to the alterative SetAuthentication method which specifies the level of Man-in-the-Middle protection required for the service.
TBTServiceSecurity::SetAuthentication(TBluetoothMitmProtection aPreference) The TBTServiceSecurity::SetAuthentication(TBluetoothMitmProtection) function should be used instead.
TBool aPreference | if aPreference = EFalse then the Bluetooth stack will not perform pairing on Bluetooth v2.0 and earlier connections. |
IMPORT_C void | SetAuthentication | ( | TBluetoothMitmProtection | aPreference | ) |
Sets the level of authentication needed for any connections to this service.
Authentication involves the comparison of a stored link key. If no link key has been generated and stored or one has been stored but is of an insufficient level of authentication then pairing will be performed.
For Bluetooth v2.0 and earlier pairing involves the user entering the same pin code for both devices involved in the connection to this service.
For Bluetooth v2.1 and onward pairing can be performed in one of four ways. Some of which involve the user of the Symbian OS device, some of which do not. The pairing performed is dependant on a number of factors including the input and output capabilities of the devices and the level of authentication (Man-in-the-Middle protection) required.
If authentication fails, or succeeds but with an insufficient level of Man-in-the-Middle protection, the connection will not be permitted.
TBluetoothMitmProtection aPreference | The level of Man-in-the-Middle protection required for authentication. |
IMPORT_C void | SetAuthorisation | ( | TBool | aPreference | ) |
Sets whether or not any connections to this service need to be authorised.
A dialog will be presented to the user alerting them of the connection. This will occur for every connection to this service unless the user has explicitly expressed their trust for the remote device during a previous connection. Note: it should not be assumed that the UI will support the setting up of trust for remote devices.
TBool aPreference |
IMPORT_C void | SetDenied | ( | TBool | aPreference | ) |
Sets whether or not connections to this service are being denied to all but specified devices.
per device overrides - service can be reached by only selected devices using this method
TBool aPreference |
IMPORT_C void | SetEncryption | ( | TBool | aPreference | ) |
Sets whether or not any connections to this service need to be encrypted.
Authentication must precede encryption, therefore it is recommended that SetAuthentication(ETrue) is also called. If encryption fails, the connection will not be permitted.
TBool aPreference |
IMPORT_C TInt | SetPasskeyMinLength | ( | TUint | aPasskeyMinLength | ) |
Sets the minimum of passkey length for connection.
TUint aPasskeyMinLength |
IMPORT_C void | SetUid | ( | TUid | aUid | ) |
Set Uid of the service - used opaquely by Bluetooth system.
When a security procedure is initiated the Uid may be given to the notifier framework. The notifier can then use the Uid to produce a displayable string detailing the service to which the security procudure pertains.
TUid aUid | The uid of the service. This is not the Bluetooth UUID, but is a Symbian-allocated Uid. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.