# WebCryptoP256.verify

Verifies a payload was signed by the provided public key.

## Imports

:::code-group
```ts [Named]
import { WebCryptoP256 } from 'ox'
```

```ts [Entrypoint]
import * as WebCryptoP256 from 'ox/WebCryptoP256'
```
:::

## Examples

```ts twoslash
import { WebCryptoP256 } from 'ox'

const { privateKey, publicKey } =
  await WebCryptoP256.createKeyPair()
const signature = await WebCryptoP256.sign({
  payload: '0xdeadbeef',
  privateKey
})

const verified = await WebCryptoP256.verify({
  // [!code focus]
  payload: '0xdeadbeef', // [!code focus]
  publicKey, // [!code focus]
  signature // [!code focus]
}) // [!code focus]
// @log: true
```

## Definition

```ts
function verify(
  options: verify.Options,
): Promise<boolean>
```

**Source:** [src/core/WebCryptoP256.ts](https://github.com/wevm/ox/blob/main/src/core/WebCryptoP256.ts#L389)

## Parameters

### options

* **Type:** `verify.Options`

The verification options.

#### options.lowS

* **Type:** `boolean`
* **Optional**

If set to `true`, only low-S signatures will be accepted.

#### options.payload

* **Type:** `0x${string} | Uint8Array`

Payload that was signed.

#### options.publicKey

* **Type:** `0x${string} | Uint8Array | { prefix: number; x: 0x${string}; y: 0x${string}; } | { prefix: number; x: 0x${string}; y?: undefined; }`

Public key that signed the payload.

Accepts a structured [`PublicKey.PublicKey`](/api/PublicKey/types#publickey), a serialized hex
string, or a `Uint8Array` (SEC1 encoding).

#### options.signature

* **Type:** `0x${string} | Uint8Array | { r: 0x${string}; s: 0x${string}; yParity?: number; }`

Signature of the payload.

Accepts a structured [`Signature.Signature`](/api/Signature/types#signature), a serialized hex
string, or a `Uint8Array`.

## Return Type

Whether the payload was signed by the provided public key.

`Promise<boolean>`
