> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# AesGcm.getKey

:::info
`AesGcm.getKey` is a re-export of ox's [`AesGcm.getKey`](https://oxlib.sh/api/AesGcm/getKey). Refer to the ox documentation for the full reference.
:::

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

## Imports

```ts
import { AesGcm } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { AesGcm } from 'viem/utils'

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

## Definition

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

## 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>`
