# cose

COSE decode-only inspection surface (FIP-1253): read an untrusted envelope
into its typed protected header, unprotected header, and recipient list.
See docs/tech-spec.md, "Wire profile" and "CDDL".

## Interfaces

| Interface | Description |
| ------ | ------ |
| [DecodedEnvelope](/reference/filoz/filecoin-encryption-envelope/namespaces/cose/interfaces/decodedenvelope/) | - |
| [DecodedProtectedHeader](/reference/filoz/filecoin-encryption-envelope/namespaces/cose/interfaces/decodedprotectedheader/) | A decoded protected header with its original encoded bytes. Use `bytes` verbatim when building the Enc_structure. |
| [DecodedRecipient](/reference/filoz/filecoin-encryption-envelope/namespaces/cose/interfaces/decodedrecipient/) | A decoded `COSE_recipient`. No key unwrapping happens at this layer. |

## Type Aliases

| Type Alias | Description |
| ------ | ------ |
| [Alg](/reference/filoz/filecoin-encryption-envelope/namespaces/cose/type-aliases/alg/) | One of the two content-encryption schemes supported by this package. |
| [UnprotectedHeaderMap](/reference/filoz/filecoin-encryption-envelope/namespaces/cose/type-aliases/unprotectedheadermap/) | Content unprotected header map. |

## Functions

| Function | Description |
| ------ | ------ |
| [decodeEnvelope](/reference/filoz/filecoin-encryption-envelope/namespaces/cose/functions/decodeenvelope/) | Decode the envelope at the start of `data`. Bytes after `envelopeLength` are untouched detached ciphertext. |

## References

### CborValue

Re-exports [CborValue](/reference/filoz/filecoin-encryption-envelope/type-aliases/cborvalue/)