# P256.getPublicKey

Computes the P256 ECDSA public key from a provided private key.

## Imports

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

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

## Examples

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

const publicKey = P256.getPublicKey({ privateKey: '0x...' })
```

## Definition

```ts
function getPublicKey<as>(
  options: getPublicKey.Options<as>,
): getPublicKey.ReturnType<as>
```

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

## Parameters

### options

* **Type:** `getPublicKey.Options<as>`

The options to compute the public key.

#### options.as

* **Type:** `"Object" | "Bytes" | "Hex" | as`
* **Optional**

Format of the returned public key.

#### options.privateKey

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

Private key to compute the public key from.

## Return Type

The computed public key.

`getPublicKey.ReturnType<as>`
