Skip to content

Registration

Utility functions and types for WebAuthn registration ceremonies (credential creation and verification).

Functions

NameDescription
Registration.createCreates a new WebAuthn P256 Credential, which can be stored and later used for signing.
Registration.deserializeOptionsDeserializes credential creation options that can be passed to navigator.credentials.create().
Registration.deserializeResponseDeserializes a serialized registration response.
Registration.getOptionsReturns the creation options for a P256 WebAuthn Credential to be used with the Web Authentication API.
Registration.serializeOptionsSerializes credential creation options into a JSON-serializable format, converting BufferSource fields to base64url strings.
Registration.serializeResponseSerializes a registration response into a JSON-serializable format, converting ArrayBuffer fields to base64url strings and the public key to a hex string.
Registration.verifyVerifies a WebAuthn registration (credential creation) response. Validates the clientDataJSON, attestationObject, authenticator flags, challenge, origin, and relying party ID, then extracts the credential ID and public key.

Errors

NameDescription
Registration.CreateFailedErrorThrown when a WebAuthn P256 credential creation fails.
Registration.VerifyErrorThrown when WebAuthn registration verification fails.

Types

NameDescription
Registration.ResponseResponse from a WebAuthn registration ceremony.