# Keystore

Ox's keystore API and its supported Node.js engine primitives.

## Examples

```ts twoslash
// @noErrors
import { Engine } from 'ox'
import { Keystore } from 'ox/node'

await Engine.install({ Keystore: Keystore.engine() })

Keystore.pbkdf2({ password: 'testpassword' })
```

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Keystore.decrypt`](/node/crypto/Keystore/decrypt) | Decrypts a [JSON keystore](https://ethereum.org/en/developers/docs/data-structures-and-encoding/web3-secret-storage/) into a private key. |
| [`Keystore.encrypt`](/node/crypto/Keystore/encrypt) | Encrypts a private key as a [JSON keystore](https://ethereum.org/en/developers/docs/data-structures-and-encoding/web3-secret-storage/) using a derived key. |
| [`Keystore.engine`](/node/crypto/Keystore/engine) | Creates a Node.js implementation of the [`Keystore`](/api/Keystore) engine slot, without installing it. |
| [`Keystore.pbkdf2`](/node/crypto/Keystore/pbkdf2) | Derives a key from a password using [PBKDF2](https://en.wikipedia.org/wiki/PBKDF2). |
| [`Keystore.pbkdf2Async`](/node/crypto/Keystore/pbkdf2Async) | Derives a key from a password using [PBKDF2](https://en.wikipedia.org/wiki/PBKDF2). |
| [`Keystore.scrypt`](/node/crypto/Keystore/scrypt) | Derives a key from a password using [scrypt](https://en.wikipedia.org/wiki/Scrypt). |
| [`Keystore.scryptAsync`](/node/crypto/Keystore/scryptAsync) | Derives a key from a password using [scrypt](https://en.wikipedia.org/wiki/Scrypt). |
| [`Keystore.toKey`](/node/crypto/Keystore/toKey) | Extracts a Key from a JSON Keystore to use for decryption. |
| [`Keystore.toKeyAsync`](/node/crypto/Keystore/toKeyAsync) | Extracts a Key asynchronously from a JSON Keystore to use for decryption. |

## Types

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Keystore.DeriveOpts`](/node/crypto/Keystore/types#keystorederiveopts) | Derivation Options. |
| [`Keystore.Key`](/node/crypto/Keystore/types#keystorekey) | Key. |
| [`Keystore.Keystore`](/node/crypto/Keystore/types#keystorekeystore) | Keystore. |
| [`Keystore.Pbkdf2DeriveOpts`](/node/crypto/Keystore/types#keystorepbkdf2deriveopts) | PBKDF2 Derivation Options. |
| [`Keystore.ScryptDeriveOpts`](/node/crypto/Keystore/types#keystorescryptderiveopts) | Scrypt Derivation Options. |
