# E2eeContactKeysManager

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#nestedclasses)\|[Constants](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#constants)\|[Methods](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#inhmethods)  

# E2eeContactKeysManager

*** ** * ** ***

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

`
public

final

class
E2eeContactKeysManager
`  
`

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


``


`

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

<br />

*** ** * ** ***

E2eeContactKeysManager provides access to the provider of end-to-end encryption contact keys. It manages two types of keys -[E2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeContactKey)and[E2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeSelfKey).

- A[E2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeContactKey)is a public key associated with a contact. It's used to end-to-end encrypt the communications between a user and the contact. This API allows operations on[E2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeContactKey)s to insert/update, remove, change the verification state, and retrieving keys (either created by or visible to the caller app).
- A[E2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeSelfKey)is a key for this device, so the key represents the owner of the device. This API allows operations on[E2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeSelfKey)s to insert/update, remove, and retrieving self keys (either created by or visible to the caller app).

Keys are uniquely identified by:

<!-- -->

- ownerPackageName - package name of an app that the key belongs to.
- deviceId - an app-specified identifier for the device, defined by the app. Within that app, the deviceID should be unique among devices belonging to that user.
- accountId - the app-specified identifier for the account for which the contact key can be used. Using different account IDs allows for multiple key entries representing the same user. For most apps this would be a phone number.

Contact keys also use lookupKey which is an opaque value used to identify a contact in ContactsProvider.

<br />

## Summary

|                                                                                                        ### Nested classes                                                                                                         ||
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [E2eeContactKeysManager.E2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeContactKey) A parcelable class encapsulating other users' end to end encrypted contact key. |
| ` class` | [E2eeContactKeysManager.E2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeSelfKey) A parcelable class encapsulating self end to end encrypted contact key.               |

|                                                                                                              ### Constants                                                                                                               ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [VERIFICATION_STATE_UNVERIFIED](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#VERIFICATION_STATE_UNVERIFIED) Unverified state of a contact end to end encrypted key.                            |
| `int` | [VERIFICATION_STATE_VERIFICATION_FAILED](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#VERIFICATION_STATE_VERIFICATION_FAILED) Failed verification state of a contact end to end encrypted key. |
| `int` | [VERIFICATION_STATE_VERIFIED](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#VERIFICATION_STATE_VERIFIED) Verified state of a contact end to end encrypted key.                                  |

|                                                                                                                                                                                                                                                                                                                                                                                                                      ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                      ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[List](https://developer.android.com/reference/java/util/List)`<`[E2eeContactKeysManager.E2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeContactKey)`>` | ` `[getAllE2eeContactKeys](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#getAllE2eeContactKeys(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` lookupKey) ` Retrieves all end-to-end encryption contact key entries that belong to apps visible to the caller.                                                                                                                                                                                                                                                                                                    |
| ` `[List](https://developer.android.com/reference/java/util/List)`<`[E2eeContactKeysManager.E2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeSelfKey)`>`       | ` `[getAllE2eeSelfKeys](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#getAllE2eeSelfKeys())`() ` Returns all end-to-end encryption self key entries that belong to apps visible to the caller.                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` `[E2eeContactKeysManager.E2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeContactKey)                                                                     | ` `[getE2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#getE2eeContactKey(java.lang.String,%20java.lang.String,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` lookupKey, `[String](https://developer.android.com/reference/java/lang/String)` deviceId, `[String](https://developer.android.com/reference/java/lang/String)` accountId) ` Retrieves an end-to-end encryption contact key entry given the lookup key, device ID, accountId and inferred caller package name.                                                                      |
| ` `[E2eeContactKeysManager.E2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeSelfKey)                                                                           | ` `[getE2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#getE2eeSelfKey(java.lang.String,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` deviceId, `[String](https://developer.android.com/reference/java/lang/String)` accountId) ` Returns an end-to-end encryption self key entry given the deviceId and the inferred package name of the caller.                                                                                                                                                                                                  |
| ` static int`                                                                                                                                                                                                  | ` `[getMaxKeySizeBytes](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#getMaxKeySizeBytes())`() ` Maximum size of an end-to-end encryption contact key.                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` `[List](https://developer.android.com/reference/java/util/List)`<`[E2eeContactKeysManager.E2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeContactKey)`>` | ` `[getOwnerE2eeContactKeys](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#getOwnerE2eeContactKeys(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` lookupKey) ` Retrieves all end-to-end encryption contact key entries for a given lookupKey that belong to the caller app.                                                                                                                                                                                                                                                                                      |
| ` `[List](https://developer.android.com/reference/java/util/List)`<`[E2eeContactKeysManager.E2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeSelfKey)`>`       | ` `[getOwnerE2eeSelfKeys](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#getOwnerE2eeSelfKeys())`() ` Returns all end-to-end encryption self key entries that are owned by the caller app.                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` boolean`                                                                                                                                                                                                     | ` `[removeE2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#removeE2eeContactKey(java.lang.String,%20java.lang.String,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` lookupKey, `[String](https://developer.android.com/reference/java/lang/String)` deviceId, `[String](https://developer.android.com/reference/java/lang/String)` accountId) ` Removes an end-to-end encryption contact key entry that belongs to the caller app.                                                                                                               |
| ` boolean`                                                                                                                                                                                                     | ` `[removeE2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#removeE2eeSelfKey(java.lang.String,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` deviceId, `[String](https://developer.android.com/reference/java/lang/String)` accountId) ` Removes an end-to-end encryption self key entry given the deviceId and the inferred package name of the caller.                                                                                                                                                                                            |
| ` boolean`                                                                                                                                                                                                     | ` `[updateE2eeContactKeyLocalVerificationState](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#updateE2eeContactKeyLocalVerificationState(java.lang.String,%20java.lang.String,%20java.lang.String,%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` lookupKey, `[String](https://developer.android.com/reference/java/lang/String)` deviceId, `[String](https://developer.android.com/reference/java/lang/String)` accountId, int localVerificationState) ` Updates an end-to-end encryption contact key entry's local verification state that belongs to the caller app.     |
| ` boolean`                                                                                                                                                                                                     | ` `[updateE2eeContactKeyRemoteVerificationState](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#updateE2eeContactKeyRemoteVerificationState(java.lang.String,%20java.lang.String,%20java.lang.String,%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` lookupKey, `[String](https://developer.android.com/reference/java/lang/String)` deviceId, `[String](https://developer.android.com/reference/java/lang/String)` accountId, int remoteVerificationState) ` Updates an end-to-end encryption contact key entry's remote verification state that belongs to the caller app. |
| ` boolean`                                                                                                                                                                                                     | ` `[updateE2eeSelfKeyRemoteVerificationState](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#updateE2eeSelfKeyRemoteVerificationState(java.lang.String,%20java.lang.String,%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` deviceId, `[String](https://developer.android.com/reference/java/lang/String)` accountId, int remoteVerificationState) ` Updates an end-to-end encryption self key entry's remote verification state.                                                                                                                                             |
| ` void`                                                                                                                                                                                                        | ` `[updateOrInsertE2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#updateOrInsertE2eeContactKey(java.lang.String,%20java.lang.String,%20java.lang.String,%20byte[]))`(`[String](https://developer.android.com/reference/java/lang/String)` lookupKey, `[String](https://developer.android.com/reference/java/lang/String)` deviceId, `[String](https://developer.android.com/reference/java/lang/String)` accountId, byte[] keyValue) ` Inserts a new entry into the end-to-end encryption contact keys table or updates one if it already exists.                                            |
| ` boolean`                                                                                                                                                                                                     | ` `[updateOrInsertE2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#updateOrInsertE2eeSelfKey(java.lang.String,%20java.lang.String,%20byte[]))`(`[String](https://developer.android.com/reference/java/lang/String)` deviceId, `[String](https://developer.android.com/reference/java/lang/String)` accountId, byte[] keyValue) ` Inserts a new entry into the end-to-end encryption self keys table or updates one if it already exists.                                                                                                                                                         |

| ### 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*.                                                                                             | ||

## Constants

### VERIFICATION_STATE_UNVERIFIED

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int VERIFICATION_STATE_UNVERIFIED
```

Unverified state of a contact end to end encrypted key.

<br />

Constant Value: 0 (0x00000000)  

### VERIFICATION_STATE_VERIFICATION_FAILED

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int VERIFICATION_STATE_VERIFICATION_FAILED
```

Failed verification state of a contact end to end encrypted key.

<br />

Constant Value: 1 (0x00000001)  

### VERIFICATION_STATE_VERIFIED

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int VERIFICATION_STATE_VERIFIED
```

Verified state of a contact end to end encrypted key.

<br />

Constant Value: 2 (0x00000002)

## Public methods

### getAllE2eeContactKeys

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public List<E2eeContactKeysManager.E2eeContactKey> getAllE2eeContactKeys (String lookupKey)
```

Retrieves all end-to-end encryption contact key entries that belong to apps visible to the caller. The keys will be stripped of deviceId, timeUpdated and keyValue data.  
Requires[Manifest.permission.READ_CONTACTS](https://developer.android.com/reference/android/Manifest.permission#READ_CONTACTS)

<br />

|                                           Parameters                                            ||
|-------------|------------------------------------------------------------------------------------|
| `lookupKey` | `String`: the value that references the contact This value cannot be`null`. <br /> |

|                                                                                                                                                                                                                             Returns                                                                                                                                                                                                                             ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [List](https://developer.android.com/reference/java/util/List)`<`[E2eeContactKeysManager.E2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeContactKey)`>` | a list of[E2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeContactKey)objects containing the contact key information, or an empty list if no keys are found. This value cannot be`null`. <br /> |

### getAllE2eeSelfKeys

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public List<E2eeContactKeysManager.E2eeSelfKey> getAllE2eeSelfKeys ()
```

Returns all end-to-end encryption self key entries that belong to apps visible to the caller. The keys will be stripped of deviceId, timeUpdated and keyValue data.  
Requires[Manifest.permission.READ_CONTACTS](https://developer.android.com/reference/android/Manifest.permission#READ_CONTACTS)

<br />

|                                                                                                                                                                                                                                   Returns                                                                                                                                                                                                                                   ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [List](https://developer.android.com/reference/java/util/List)`<`[E2eeContactKeysManager.E2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeSelfKey)`>` | a list of[E2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeSelfKey)objects containing the end-to-end encryption self key information, or an empty list if no self keys are found. This value cannot be`null`. <br /> |

### getE2eeContactKey

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public E2eeContactKeysManager.E2eeContactKey getE2eeContactKey (String lookupKey, 
                String deviceId, 
                String accountId)
```

Retrieves an end-to-end encryption contact key entry given the lookup key, device ID, accountId and inferred caller package name.  
Requires[Manifest.permission.READ_CONTACTS](https://developer.android.com/reference/android/Manifest.permission#READ_CONTACTS)

<br />

|                                              Parameters                                               ||
|-------------|------------------------------------------------------------------------------------------|
| `lookupKey` | `String`: the value that references the contact This value cannot be`null`. <br />       |
| `deviceId`  | `String`: an app-specified identifier for the device This value cannot be`null`. <br />  |
| `accountId` | `String`: an app-specified identifier for the account This value cannot be`null`. <br /> |

|                                                                                                                                                                       Returns                                                                                                                                                                       ||
|-----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [E2eeContactKeysManager.E2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeContactKey) | a[E2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeContactKey)object containing the contact key information, or null if no contact key is found. <br /> |

### getE2eeSelfKey

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public E2eeContactKeysManager.E2eeSelfKey getE2eeSelfKey (String deviceId, 
                String accountId)
```

Returns an end-to-end encryption self key entry given the deviceId and the inferred package name of the caller.  
Requires[Manifest.permission.READ_CONTACTS](https://developer.android.com/reference/android/Manifest.permission#READ_CONTACTS)

<br />

|                                              Parameters                                               ||
|-------------|------------------------------------------------------------------------------------------|
| `deviceId`  | `String`: an app-specified identifier for the device This value cannot be`null`. <br />  |
| `accountId` | `String`: an app-specified identifier for the account This value cannot be`null`. <br /> |

|                                                                                                                                                                         Returns                                                                                                                                                                         ||
|-----------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [E2eeContactKeysManager.E2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeSelfKey) | a[E2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeSelfKey)object containing the end-to-end encryption self key information, or null if no self key is found. <br /> |

### getMaxKeySizeBytes

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static int getMaxKeySizeBytes ()
```

Maximum size of an end-to-end encryption contact key.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### getOwnerE2eeContactKeys

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public List<E2eeContactKeysManager.E2eeContactKey> getOwnerE2eeContactKeys (String lookupKey)
```

Retrieves all end-to-end encryption contact key entries for a given lookupKey that belong to the caller app.  
Requires[Manifest.permission.READ_CONTACTS](https://developer.android.com/reference/android/Manifest.permission#READ_CONTACTS)

<br />

|                                           Parameters                                            ||
|-------------|------------------------------------------------------------------------------------|
| `lookupKey` | `String`: the value that references the contact This value cannot be`null`. <br /> |

|                                                                                                                                                                                                                                        Returns                                                                                                                                                                                                                                        ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [List](https://developer.android.com/reference/java/util/List)`<`[E2eeContactKeysManager.E2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeContactKey)`>` | a list of[E2eeContactKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeContactKey)objects containing the end-to-end encryption contact key information, or an empty list if no keys are found. This value cannot be`null`. <br /> |

### getOwnerE2eeSelfKeys

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public List<E2eeContactKeysManager.E2eeSelfKey> getOwnerE2eeSelfKeys ()
```

Returns all end-to-end encryption self key entries that are owned by the caller app.  
Requires[Manifest.permission.READ_CONTACTS](https://developer.android.com/reference/android/Manifest.permission#READ_CONTACTS)

<br />

|                                                                                                                                                                                                                                   Returns                                                                                                                                                                                                                                   ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [List](https://developer.android.com/reference/java/util/List)`<`[E2eeContactKeysManager.E2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeSelfKey)`>` | a list of[E2eeSelfKey](https://developer.android.com/reference/android/provider/E2eeContactKeysManager.E2eeSelfKey)objects containing the end-to-end encryption self key information, or an empty list if no self keys are found. This value cannot be`null`. <br /> |

### removeE2eeContactKey

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean removeE2eeContactKey (String lookupKey, 
                String deviceId, 
                String accountId)
```

Removes an end-to-end encryption contact key entry that belongs to the caller app.  
Requires[Manifest.permission.WRITE_CONTACTS](https://developer.android.com/reference/android/Manifest.permission#WRITE_CONTACTS)

<br />

|                                              Parameters                                               ||
|-------------|------------------------------------------------------------------------------------------|
| `lookupKey` | `String`: the value that references the contact This value cannot be`null`. <br />       |
| `deviceId`  | `String`: an app-specified identifier for the device This value cannot be`null`. <br />  |
| `accountId` | `String`: an app-specified identifier for the account This value cannot be`null`. <br /> |

|                              Returns                              ||
|-----------|--------------------------------------------------------|
| `boolean` | true if the entry was removed, false otherwise. <br /> |

### removeE2eeSelfKey

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean removeE2eeSelfKey (String deviceId, 
                String accountId)
```

Removes an end-to-end encryption self key entry given the deviceId and the inferred package name of the caller.  
Requires[Manifest.permission.WRITE_CONTACTS](https://developer.android.com/reference/android/Manifest.permission#WRITE_CONTACTS)

<br />

|                                              Parameters                                               ||
|-------------|------------------------------------------------------------------------------------------|
| `deviceId`  | `String`: an app-specified identifier for the device This value cannot be`null`. <br />  |
| `accountId` | `String`: an app-specified identifier for the account This value cannot be`null`. <br /> |

|                              Returns                              ||
|-----------|--------------------------------------------------------|
| `boolean` | true if the entry was removed, false otherwise. <br /> |

### updateE2eeContactKeyLocalVerificationState

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean updateE2eeContactKeyLocalVerificationState (String lookupKey, 
                String deviceId, 
                String accountId, 
                int localVerificationState)
```

Updates an end-to-end encryption contact key entry's local verification state that belongs to the caller app.  
Requires[Manifest.permission.WRITE_CONTACTS](https://developer.android.com/reference/android/Manifest.permission#WRITE_CONTACTS)

<br />

|                                                                                                                                                                                                                                                                   Parameters                                                                                                                                                                                                                                                                   ||
|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `lookupKey`              | `String`: the value that references the contact This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `deviceId`               | `String`: an app-specified identifier for the device This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `accountId`              | `String`: an app-specified identifier for the account This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `localVerificationState` | `int`: the new local verification state Value is[VERIFICATION_STATE_UNVERIFIED](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#VERIFICATION_STATE_UNVERIFIED),[VERIFICATION_STATE_VERIFICATION_FAILED](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#VERIFICATION_STATE_VERIFICATION_FAILED), or[VERIFICATION_STATE_VERIFIED](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#VERIFICATION_STATE_VERIFIED) <br /> |

|                              Returns                              ||
|-----------|--------------------------------------------------------|
| `boolean` | true if the entry was updated, false otherwise. <br /> |

### updateE2eeContactKeyRemoteVerificationState

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean updateE2eeContactKeyRemoteVerificationState (String lookupKey, 
                String deviceId, 
                String accountId, 
                int remoteVerificationState)
```

Updates an end-to-end encryption contact key entry's remote verification state that belongs to the caller app.  
Requires[Manifest.permission.WRITE_CONTACTS](https://developer.android.com/reference/android/Manifest.permission#WRITE_CONTACTS)

<br />

|                                                                                                                                                                                                                                                                    Parameters                                                                                                                                                                                                                                                                    ||
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `lookupKey`               | `String`: the value that references the contact This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `deviceId`                | `String`: an app-specified identifier for the device This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `accountId`               | `String`: an app-specified identifier for the account This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `remoteVerificationState` | `int`: the new remote verification state Value is[VERIFICATION_STATE_UNVERIFIED](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#VERIFICATION_STATE_UNVERIFIED),[VERIFICATION_STATE_VERIFICATION_FAILED](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#VERIFICATION_STATE_VERIFICATION_FAILED), or[VERIFICATION_STATE_VERIFIED](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#VERIFICATION_STATE_VERIFIED) <br /> |

|                              Returns                              ||
|-----------|--------------------------------------------------------|
| `boolean` | true if the entry was updated, false otherwise. <br /> |

### updateE2eeSelfKeyRemoteVerificationState

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean updateE2eeSelfKeyRemoteVerificationState (String deviceId, 
                String accountId, 
                int remoteVerificationState)
```

Updates an end-to-end encryption self key entry's remote verification state.  
Requires[Manifest.permission.WRITE_CONTACTS](https://developer.android.com/reference/android/Manifest.permission#WRITE_CONTACTS)

<br />

|                                                                                                                                                                                                                                                                    Parameters                                                                                                                                                                                                                                                                    ||
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `deviceId`                | `String`: an app-specified identifier for the device This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `accountId`               | `String`: an app-specified identifier for the account This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `remoteVerificationState` | `int`: the new remote verification state Value is[VERIFICATION_STATE_UNVERIFIED](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#VERIFICATION_STATE_UNVERIFIED),[VERIFICATION_STATE_VERIFICATION_FAILED](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#VERIFICATION_STATE_VERIFICATION_FAILED), or[VERIFICATION_STATE_VERIFIED](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#VERIFICATION_STATE_VERIFIED) <br /> |

|                              Returns                              ||
|-----------|--------------------------------------------------------|
| `boolean` | true if the entry was updated, false otherwise. <br /> |

### updateOrInsertE2eeContactKey

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void updateOrInsertE2eeContactKey (String lookupKey, 
                String deviceId, 
                String accountId, 
                byte[] keyValue)
```

Inserts a new entry into the end-to-end encryption contact keys table or updates one if it already exists. The inserted/updated end-to-end encryption contact key is owned by the caller app.  
Requires[Manifest.permission.WRITE_CONTACTS](https://developer.android.com/reference/android/Manifest.permission#WRITE_CONTACTS)

<br />

|                                                                                                            Parameters                                                                                                            ||
|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `lookupKey` | `String`: value that references the contact This value cannot be`null`. <br />                                                                                                                                      |
| `deviceId`  | `String`: an app-specified identifier for the device This value cannot be`null`. <br />                                                                                                                             |
| `accountId` | `String`: an app-specified identifier for the account This value cannot be`null`. <br />                                                                                                                            |
| `keyValue`  | `byte`: the raw bytes for the key (max size is[getMaxKeySizeBytes()](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#getMaxKeySizeBytes())bytes) This value cannot be`null`. <br /> |

### updateOrInsertE2eeSelfKey

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean updateOrInsertE2eeSelfKey (String deviceId, 
                String accountId, 
                byte[] keyValue)
```

Inserts a new entry into the end-to-end encryption self keys table or updates one if it already exists.  
Requires[Manifest.permission.WRITE_CONTACTS](https://developer.android.com/reference/android/Manifest.permission#WRITE_CONTACTS)

<br />

|                                                                                                            Parameters                                                                                                            ||
|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `deviceId`  | `String`: an app-specified identifier for the device This value cannot be`null`. <br />                                                                                                                             |
| `accountId` | `String`: an app-specified identifier for the account This value cannot be`null`. <br />                                                                                                                            |
| `keyValue`  | `byte`: the raw bytes for the key (max size is[getMaxKeySizeBytes()](https://developer.android.com/reference/android/provider/E2eeContactKeysManager#getMaxKeySizeBytes())bytes) This value cannot be`null`. <br /> |

|                                  Returns                                   ||
|-----------|-----------------------------------------------------------------|
| `boolean` | true if the entry was added or updated, false otherwise. <br /> |