WebAuthnP256.sign
Signs a challenge using a stored WebAuthn P256 Credential. If no Credential is provided, a prompt will be displayed for the user to select an existing Credential that was previously registered.
Imports
Named
import { WebAuthnP256 } from 'ox'Examples
import { WebAuthnP256 } from 'ox'
const credential = await WebAuthnP256.createCredential({
name: 'Example',
})
const { metadata, signature } = await WebAuthnP256.sign({
credentialId: credential.id,
challenge: '0xdeadbeef',
})
{ metadata: { authenticatorData: '0x49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97630500000000', clientDataJSON: '{"type":"webauthn.get","challenge":"9jEFijuhEWrM4SOW-tChJbUEHEP44VcjcJ-Bqo1fTM8","origin":"http://localhost:5173","crossOrigin":false}', challengeIndex: 23, typeIndex: 1, userVerificationRequired: true, }, signature: { r: 51231...4215n, s: 12345...6789n }, }Definition
function sign(
options: sign.Options,
): Promise<sign.ReturnType>Source: src/core/WebAuthnP256.ts
Parameters
options
- Type:
sign.Options
Options.
Return Type
The signature.
Promise<sign.ReturnType>

