# AesGcm.getKey

Derives an AES-GCM key from a password using PBKDF2.

## Imports

:::code-group
```ts [Named]
import { AesGcm } from 'ox'
```

```ts [Entrypoint]
import * as AesGcm from 'ox/AesGcm'
```
:::

## Examples

```ts twoslash
import { AesGcm } from 'ox'

const key = await AesGcm.getKey({ password: 'qwerty' })
// @log: CryptoKey {}
```

## Definition

```ts
function getKey(
  options: getKey.Options,
): Promise<CryptoKey>
```

**Source:** [src/core/AesGcm.ts](https://github.com/wevm/ox/blob/main/src/core/AesGcm.ts#L209)

## Parameters

### options

* **Type:** `getKey.Options`

Options for key derivation.

#### options.iterations

* **Type:** `number`
* **Optional**

The number of iterations to use.

#### options.password

* **Type:** `string`

Password to derive key from.

#### options.salt

* **Type:** `Uint8Array`
* **Optional**

Salt to use for key derivation.

## Return Type

The derived key.

`Promise<CryptoKey>`
