Skip to content

P256.createKeyPair

Creates a new P256 ECDSA key pair consisting of a private key and its corresponding public key.

Imports

Named
import { P256 } from 'ox'

Examples

import { P256 } from 'ox'
 
const { privateKey, publicKey } = P256.createKeyPair()

Definition

function createKeyPair<as>(
  options?: createKeyPair.Options<as>,
): createKeyPair.ReturnType<as>

Source: src/core/P256.ts

Parameters

options

  • Type: createKeyPair.Options<as>
  • Optional

The options to generate the key pair.

options.as

  • Type: "Bytes" | "Hex" | as
  • Optional

Format of the returned private key.

Return Type

The generated key pair containing both private and public keys.

createKeyPair.ReturnType<as>