Skip to content

P256.sign

Signs the payload with the provided private key and returns a P256 signature.

Imports

Named
import { P256 } from 'ox'

Examples

import { P256 } from 'ox'
 
const signature = P256.sign({ 
  payload: '0xdeadbeef', 
  privateKey: '0x...'
})

Definition

function sign(
  options: sign.Options,
): Signature.Signature

Source: src/P256.ts

Parameters

options

  • Type: sign.Options

The signing options.

options.hash

  • Type: boolean
  • Optional

If set to true, the payload will be hashed (sha256) before being signed.

options.payload

  • Type: 0x${string} | Uint8Array

Payload to sign.

options.privateKey

  • Type: 0x${string} | Uint8Array

ECDSA private key.

Return Type

The ECDSA Signature.Signature.

Signature.Signature

Error Type

P256.sign.ErrorType