final class WebAuthn

This class provides a static interface to the webauthn-lib package, handling serialization, deserialization, and validation of WebAuthn ceremonies.

Methods

static string
toJson(mixed $data)

Serialize data to JSON.

static array
toBrowserArray(mixed $data)

Serialize data to a browser-facing array, omitting null values.

static object
fromJson(string $json, string $class)

Deserialize JSON to a specific class.

static AuthenticatorAttestationResponseValidator
attestationValidator()

Create the attestation response validator for registration ceremonies.

static AuthenticatorAssertionResponseValidator
assertionValidator()

Create the assertion response validator for verification ceremonies.

static void
configureCeremonyStepManagerFactoryUsing(callable|null $callback)

Configure the ceremony step manager factory.

static void
flushState()

Flush all static state.

Details

at line 54
static string toJson(mixed $data)

Serialize data to JSON.

Parameters

mixed $data

Return Value

string

at line 64
static array toBrowserArray(mixed $data)

Serialize data to a browser-facing array, omitting null values.

Parameters

mixed $data

Return Value

array

at line 85
static object fromJson(string $json, string $class)

Deserialize JSON to a specific class.

Parameters

string $json
string $class

Return Value

object

at line 99
static AuthenticatorAttestationResponseValidator attestationValidator()

Create the attestation response validator for registration ceremonies.

Return Value

AuthenticatorAttestationResponseValidator

at line 111
static AuthenticatorAssertionResponseValidator assertionValidator()

Create the assertion response validator for verification ceremonies.

Return Value

AuthenticatorAssertionResponseValidator

at line 127
static void configureCeremonyStepManagerFactoryUsing(callable|null $callback)

Configure the ceremony step manager factory.

The callback persists in static state for the worker lifetime and affects every subsequent WebAuthn ceremony.

Parameters

callable|null $callback

Return Value

void

at line 205
static void flushState()

Flush all static state.

Return Value

void