# Function: createMeshAuth()

```ts
function createMeshAuth(
   spaceId, 
   session, 
   read, 
   provider
): MeshAuth;
```

Defined in: [packages/core/src/network/peer-auth.ts:319](https://github.com/leifriksheim/minca/blob/main/core/src/network/peer-auth.ts#L319)

One side of the handshake between peers; `read` is, in a private space, the read key to prove with and the public half to check others against.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `spaceId` | `string` |
| `session` | \{ `did`: `string`; `key`: `CryptoKey`; \} |
| `session.did` | `string` |
| `session.key` | `CryptoKey` |
| `read` | `ReadAccessInput` \| `null` |
| `provider` | [`CryptoProvider`](https://minca.dev/api/core/interfaces/CryptoProvider.md) |

## Returns

`MeshAuth`
