# P256

Ox's P256 API and its Node.js public-key derivation engine primitive.

## Examples

```ts twoslash
// @noErrors
import { Engine } from 'ox'
import { P256 } from 'ox/node'

await Engine.install({ P256: P256.engine() })

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

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`P256.createKeyPair`](/node/crypto/P256/createKeyPair) | Creates a new P256 ECDSA key pair consisting of a private key and its corresponding public key. |
| [`P256.engine`](/node/crypto/P256/engine) | Creates a Node.js implementation of the [`P256`](/api/P256) engine slot, without installing it. |
| [`P256.getPublicKey`](/node/crypto/P256/getPublicKey) | Computes the P256 ECDSA public key from a provided private key. |
| [`P256.getSharedSecret`](/node/crypto/P256/getSharedSecret) | Computes a shared secret using ECDH (Elliptic Curve Diffie-Hellman) between a private key and a public key. |
| [`P256.randomPrivateKey`](/node/crypto/P256/randomPrivateKey) | Generates a random P256 ECDSA private key. |
| [`P256.recoverPublicKey`](/node/crypto/P256/recoverPublicKey) | Recovers the signing public key from the signed payload and signature. |
| [`P256.sign`](/node/crypto/P256/sign) | Signs the payload with the provided private key and returns a P256 signature. |
| [`P256.verify`](/node/crypto/P256/verify) | Verifies a payload was signed by the provided public key. |
