# encStructure

> **encStructure**(`tag`, `protectedHeaderBytes`): [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)

Defined in: [packages/filecoin-encryption-envelope/src/cose/enc-structure.ts:41](https://github.com/FilOzone/synapse-sdk/blob/9ad84d812e1dd635b76420a7d9388555a04f31b6/packages/filecoin-encryption-envelope/src/cose/enc-structure.ts#L41)

Build the `Enc_structure` bytes for an envelope:
`[context, protected, external_aad]`, with `external_aad` always empty.

`protectedHeaderBytes` must be the exact bytes from the wire when decoding,
or the bytes returned by `encodeProtectedHeader()` when encoding. Do not
re-encode a decoded header map, as the resulting bytes may differ and break
authentication.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `tag` | [`EnvelopeTag`](/reference/filoz/filecoin-encryption-envelope/namespaces/cose/type-aliases/envelopetag/) |
| `protectedHeaderBytes` | [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) |

## Returns

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