# EncryptionStatus

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Summary:[Ctors](https://developer.android.com/reference/android/bluetooth/EncryptionStatus#pubctors)\|[Methods](https://developer.android.com/reference/android/bluetooth/EncryptionStatus#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/bluetooth/EncryptionStatus#inhmethods)  

# EncryptionStatus

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/bluetooth/EncryptionStatus "View this page in Kotlin")\|Java

`
public

final

class
EncryptionStatus
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.bluetooth.EncryptionStatus |

<br />

*** ** * ** ***

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](https://developer.android.com/reference/android/bluetooth/EncryptionStatus#EncryptionStatus(int,%20int))`(int keySize, int algorithm) ` |

|                                                                                                       ### Public methods                                                                                                        ||
|-----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`                                                                | ` `[getAlgorithm](https://developer.android.com/reference/android/bluetooth/EncryptionStatus#getAlgorithm())`() `                                        |
| ` int`                                                                | ` `[getKeySize](https://developer.android.com/reference/android/bluetooth/EncryptionStatus#getKeySize())`() `                                            |
| ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[toString](https://developer.android.com/reference/android/bluetooth/EncryptionStatus#toString())`() ` Returns a string representation of the object. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### EncryptionStatus

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  

```
public EncryptionStatus (int keySize, 
                int algorithm)
```

<br />

<br />

|                                                                                                                                                                                                                                                                                                                Parameters                                                                                                                                                                                                                                                                                                                 ||
|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `keySize`   | `int`: Value is between 1 and 16 inclusive <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `algorithm` | `int`: Value is[BluetoothDevice.ENCRYPTION_ALGORITHM_NONE](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_NONE),[BluetoothDevice.ENCRYPTION_ALGORITHM_E0](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_E0),[BluetoothDevice.ENCRYPTION_ALGORITHM_AES](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_AES), or[BluetoothDevice.ENCRYPTION_ALGORITHM_UNKNOWN](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_UNKNOWN) <br /> |

## Public methods

### getAlgorithm

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  

```
public int getAlgorithm ()
```

<br />

<br />

|                                                                                                                                                                                                                                                                                                                                         Returns                                                                                                                                                                                                                                                                                                                                         ||
|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | the encryption algorithm used for the encrypting the link. Value is[BluetoothDevice.ENCRYPTION_ALGORITHM_NONE](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_NONE),[BluetoothDevice.ENCRYPTION_ALGORITHM_E0](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_E0),[BluetoothDevice.ENCRYPTION_ALGORITHM_AES](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_AES), or[BluetoothDevice.ENCRYPTION_ALGORITHM_UNKNOWN](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_UNKNOWN) <br /> |

### getKeySize

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  

```
public int getKeySize ()
```

<br />

<br />

|                                                                           Returns                                                                            ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
| `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 <br /> |

### toString

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  

```
public String toString ()
```

Returns a string representation of the object.

<br />

|                                                      Returns                                                      ||
|--------------------------------------------------------------------|-----------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | a string representation of the object. <br /> |