Skip to content

WebAuthnP256.createCredential

Creates a new WebAuthn P256 Credential, which can be stored and later used for signing.

Imports

Named
import { WebAuthnP256 } from 'ox'

Examples

import { WebAuthnP256 } from 'ox'
 
const credential = await WebAuthnP256.createCredential({ name: 'Example' })
{
id: 'oZ48...',
publicKey: { x: 51421...5123n, y: 12345...6789n },
raw: PublicKeyCredential {},
}
const { metadata, signature } = await WebAuthnP256.sign({ credentialId: credential.id, challenge: '0xdeadbeef', })

Definition

function createCredential(
  options: createCredential.Options,
): Promise<P256Credential>

Source: src/core/WebAuthnP256.ts

Parameters

options

  • Type: createCredential.Options

Credential creation options.

Return Type

A WebAuthn P256 credential.

Promise<P256Credential>