Skip to content
docsv0.9.0

WebAuthnCredentialRecord

The storage-agnostic record of a registered passkey — a credential's public key and metadata, owned by an actor. Mirrors {@see \Milpa\Auth\SessionRecord}: the leaf-clean shape a {@see Contracts\WebAuthnCredentialStore} moves, knowing nothing about where it is kept. The public key is not a secret; `signCount` is a clone-detection SIGNAL, not an authorization gate.

WebAuthnCredentialRecord::__construct()

public function __construct(string $credentialId, string $publicKeyCose, int $signCount, string $actorId, ?string $aaguid, array $transports, DateTimeImmutable $createdAt, ?DateTimeImmutable $lastUsedAt = null):

Parameters

Parameters of __construct()
NameTypeDescription
$credentialIdstring
$publicKeyCosestring
$signCountint
$actorIdstring
$aaguid?string
$transportslist<string>the authenticator transports the browser reported
$createdAtDateTimeImmutable
$lastUsedAt?DateTimeImmutable

WebAuthnCredentialRecord::withSignCount()

public function withSignCount(int $signCount): self

A copy with an updated sign counter (recorded on each assertion; never used to reject).

Parameters

Parameters of withSignCount()
NameTypeDescription
$signCountint

WebAuthnCredentialRecord::touch()

public function touch(DateTimeImmutable $now): self

A copy stamped as just used at $now.

Parameters

Parameters of touch()
NameTypeDescription
$nowDateTimeImmutable