# keyResolver

> **keyResolver**(`node`, `holding?`): (`info`) => [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)

Defined in: [derive.ts:437](https://github.com/FilOzone/synapse-sdk/blob/68e30a2a5457180e60a5579eb5ecff90b65894b3/packages/keysmith/src/derive.ts#L437)

A FEE key resolver for pieces this node reaches: pass it to `fee.decrypt()`,
which calls it with the envelope's metadata before decrypting a byte.

```ts
await encrypted.pipeThrough(fee.decrypt(Keysmith.keyResolver(kk))).pipeTo(sink)
```

The metadata is not yet authenticated when FEE calls this; it is checked as
strictly as any other envelope, and a tampered label derives a key that the
content tags then reject.

## Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `node` | [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | `undefined` |
| `holding` | [`GrantDescriptor`](/reference/filoz/keysmith/interfaces/grantdescriptor/) \| [`Holding`](/reference/filoz/keysmith/type-aliases/holding/) | `'keyspace'` |

## Returns

(`info`) => [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)