# Registration

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

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Registration.create`](/webauthn/webauthn/Registration/create) | Creates a new WebAuthn P256 Credential, which can be stored and later used for signing. |
| [`Registration.deserializeOptions`](/webauthn/webauthn/Registration/deserializeOptions) | Deserializes credential creation options that can be passed to `navigator.credentials.create()`. |
| [`Registration.deserializeResponse`](/webauthn/webauthn/Registration/deserializeResponse) | Deserializes a serialized registration response. |
| [`Registration.getOptions`](/webauthn/webauthn/Registration/getOptions) | Returns the creation options for a P256 WebAuthn Credential to be used with the Web Authentication API. |
| [`Registration.serializeOptions`](/webauthn/webauthn/Registration/serializeOptions) | Serializes credential creation options into a JSON-serializable format, converting `BufferSource` fields to base64url strings. |
| [`Registration.serializeResponse`](/webauthn/webauthn/Registration/serializeResponse) | Serializes a registration response into a JSON-serializable format, converting `ArrayBuffer` fields to base64url strings and the public key to a hex string. |
| [`Registration.verify`](/webauthn/webauthn/Registration/verify) | Verifies 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

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Registration.CreateFailedError`](/webauthn/webauthn/Registration/errors#registrationcreatefailederror) | Thrown when a WebAuthn P256 credential creation fails. |
| [`Registration.VerifyError`](/webauthn/webauthn/Registration/errors#registrationverifyerror) | Thrown when WebAuthn registration verification fails. |

## Types

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Registration.Response`](/webauthn/webauthn/Registration/types#registrationresponse) | Response from a WebAuthn registration ceremony. |
