# IdentityKey

Artifact: [androidx.credentials:credentials-e2ee](https://developer.android.com/jetpack/androidx/releases/credentials) [View Source](https://cs.android.com/search?q=file:androidx/credentials/e2ee/IdentityKey.kt+class:androidx.credentials.e2ee.IdentityKey) Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/credentials#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/credentials#1.0.0-alpha03)

*** ** * ** ***


```
class IdentityKey
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> This API is deprecated and will be removed in a future release.

A public-private key pair usable for signing, representing an end user identity in an end-to-end encrypted messaging system.

This API is deprecated and will be removed in a future release.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey#IDENTITY_KEY_TYPE_ED25519() = 6` **This property is deprecated.** This API is deprecated and will be removed in a future release. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey#IDENTITY_KEY_TYPE_RESERVED() = 0` **This property is deprecated.** This API is deprecated and will be removed in a future release. |

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey` | `@https://developer.android.com/reference/kotlin/androidx/annotation/WorkerThread [createFromPrf](https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey#createFromPrf(kotlin.ByteArray,kotlin.ByteArray,kotlin.Int))(prf: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html, salt: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html?, keyType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** This API is deprecated and will be removed in a future release. |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[equals](https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey#equals(kotlin.Any))(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` **This function is deprecated.** This API is deprecated and will be removed in a future release. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[hashCode](https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey#hashCode())()` **This function is deprecated.** This API is deprecated and will be removed in a future release. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey#private()` **This property is deprecated.** This API is deprecated and will be removed in a future release. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey#public()` **This property is deprecated.** This API is deprecated and will be removed in a future release. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey#type()` **This property is deprecated.** This API is deprecated and will be removed in a future release. |

## Constants

### IDENTITY_KEY_TYPE_ED25519

```
const val IDENTITY_KEY_TYPE_ED25519 = 6: Int
```

> [!CAUTION]
> **This property is deprecated.**   
> This API is deprecated and will be removed in a future release.

A signing key on Ed25519. The value matches https://www.iana.org/assignments/cose/cose.xhtml#algorithms

### IDENTITY_KEY_TYPE_RESERVED

```
const val IDENTITY_KEY_TYPE_RESERVED = 0: Int
```

> [!CAUTION]
> **This property is deprecated.**   
> This API is deprecated and will be removed in a future release.

The default signing key type, which should not be used. This is required to match https://www.iana.org/assignments/cose/cose.xhtml#algorithms

## Public companion functions

### createFromPrf

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/credentials#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/credentials#1.0.0-alpha03)

```
@WorkerThread
fun [createFromPrf](https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey#createFromPrf(kotlin.ByteArray,kotlin.ByteArray,kotlin.Int))(prf: ByteArray, salt: ByteArray?, keyType: Int): IdentityKey
```

> [!CAUTION]
> **This function is deprecated.**   
> This API is deprecated and will be removed in a future release.

Creates a `https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey`, a public/private key pair usable for signing. It is intended for use with the WebAuthn PRF extension (https://w3c.github.io/webauthn/#prf-extension). The generated IdentityKey is deterministic given prf and salt, thus the prf value must be kept secret. Currently, only Ed25519 is supported as a key type.

This API is deprecated and will be removed in a future release.

| Parameters |
|---|---|
| `prf: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` | The PRF output of WebAuthn used in the key derivation. |
| `salt: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html?` | An optional salt used in the key derivation. |
| `keyType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The type of IdentityKey to generate, e.g. Ed25519. Value is one of the following: - `0` - `6` <br /> |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey` | a `https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey`, a public/private key pair usable for signing. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the key type is not supported. |

## Public functions

### equals

```
open operator fun [equals](https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey#equals(kotlin.Any))(other: Any?): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> This API is deprecated and will be removed in a future release.

### hashCode

```
open fun [hashCode](https://developer.android.com/reference/kotlin/androidx/credentials/e2ee/IdentityKey#hashCode())(): Int
```

> [!CAUTION]
> **This function is deprecated.**   
> This API is deprecated and will be removed in a future release.

## Public properties

### private

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/credentials#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/credentials#1.0.0-alpha03)

```
val private: ByteArray
```

> [!CAUTION]
> **This property is deprecated.**   
> This API is deprecated and will be removed in a future release.

The private key, stored as a byte array.

### public

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/credentials#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/credentials#1.0.0-alpha03)

```
val public: ByteArray
```

> [!CAUTION]
> **This property is deprecated.**   
> This API is deprecated and will be removed in a future release.

The public key, stored as a byte array.

### type

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/credentials#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/credentials#1.0.0-alpha03)

```
val type: Int
```

> [!CAUTION]
> **This property is deprecated.**   
> This API is deprecated and will be removed in a future release.

The type of signing key, e.g. Ed25519.

Value is one of the following:

- `0`
- `6`

<br />