Stay organized with collections
Save and categorize content based on your preferences.
EncryptionStatus
class EncryptionStatus
Represents the encryption status of a Bluetooth device.
This class is used to hold the encryption status details like key size and algorithm of a Bluetooth device.
Summary
Public constructors
EncryptionStatus
EncryptionStatus(
keySize: Int,
algorithm: Int)
Public methods
getAlgorithm
fun getAlgorithm(): Int
getKeySize
fun getKeySize(): Int
Return |
Int |
the size of the encryption key, in number of bytes. i.e. value of 16 means 16-octets, or 128 bit key size. Value is between 1 and 16 inclusive |
toString
fun toString(): String
Return |
String |
a string representation of the object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[],[],null,["# EncryptionStatus\n\nAdded in [API level Baklava](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nEncryptionStatus\n================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/bluetooth/EncryptionStatus \"View this page in Java\") \n\n```\nclass EncryptionStatus\n```\n\n|---|-----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.bluetooth.EncryptionStatus](#) |\n\nRepresents the encryption status of a Bluetooth device.\n\nThis class is used to hold the encryption status details like key size and algorithm of a Bluetooth device.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [EncryptionStatus](#EncryptionStatus(kotlin.Int,%20kotlin.Int))`(`keySize:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `algorithm:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` \u003cbr /\u003e |\n\n| Public methods ||\n|----------------------------------------------------------------------------------|--------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getAlgorithm](#getAlgorithm())`()` \u003cbr /\u003e |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getKeySize](#getKeySize())`()` \u003cbr /\u003e |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` \u003cbr /\u003e |\n\nPublic constructors\n-------------------\n\n### EncryptionStatus\n\nAdded in [API level Baklava](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nEncryptionStatus(\n keySize: Int, \n algorithm: Int)\n```\n\n| Parameters ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `keySize` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is between 1 and 16 inclusive |\n| `algorithm` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is [android.bluetooth.BluetoothDevice#ENCRYPTION_ALGORITHM_NONE](/reference/kotlin/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_NONE:kotlin.Int), [android.bluetooth.BluetoothDevice#ENCRYPTION_ALGORITHM_E0](/reference/kotlin/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_E0:kotlin.Int), [android.bluetooth.BluetoothDevice#ENCRYPTION_ALGORITHM_AES](/reference/kotlin/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_AES:kotlin.Int), or [android.bluetooth.BluetoothDevice#ENCRYPTION_ALGORITHM_UNKNOWN](/reference/kotlin/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_UNKNOWN:kotlin.Int) |\n\nPublic methods\n--------------\n\n### getAlgorithm\n\nAdded in [API level Baklava](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getAlgorithm(): Int\n```\n\n| Return ||\n|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the encryption algorithm used for the encrypting the link. Value is [android.bluetooth.BluetoothDevice#ENCRYPTION_ALGORITHM_NONE](/reference/kotlin/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_NONE:kotlin.Int), [android.bluetooth.BluetoothDevice#ENCRYPTION_ALGORITHM_E0](/reference/kotlin/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_E0:kotlin.Int), [android.bluetooth.BluetoothDevice#ENCRYPTION_ALGORITHM_AES](/reference/kotlin/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_AES:kotlin.Int), or [android.bluetooth.BluetoothDevice#ENCRYPTION_ALGORITHM_UNKNOWN](/reference/kotlin/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_UNKNOWN:kotlin.Int) |\n\n### getKeySize\n\nAdded in [API level Baklava](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getKeySize(): Int\n```\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the size of the encryption key, in number of bytes. i.e. value of 16 means 16-octets, or 128 bit key size. Value is between 1 and 16 inclusive |\n\n### toString\n\nAdded in [API level Baklava](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun toString(): String\n```\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |"]]