# unwrapWith

> **unwrapWith**(`privateKey`, `input`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>\>

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

Open a grant with the recipient's private key: the grant as delivered, in
bytes, or as decoded by [decodeGrant](/reference/filoz/keysmith/functions/decodegrant/).

## Parameters

| Parameter | Type |
| ------ | ------ |
| `privateKey` | `` `0x${string}` `` |
| `input` | [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> \| [`Grant`](/reference/filoz/keysmith/interfaces/grant/) |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>\>

## Throws

If the grant was not addressed to this key, its descriptor was
altered, or it is not a grant this version understands.