Skip to content
docsv0.9.0

PasskeyCredentialStore

Remembers the passkeys a house has registered, so an assertion can be checked against the right key. Registration writes a credential here; authentication reads it back by id to find the public key, and advances its sign counter afterward. The counter is the clone tripwire (§6.1.1 of WebAuthn): it must only ever climb, so the store must persist the last value it saw.

PasskeyCredentialStore::register()

abstract public function register(Milpa\Auth\WebAuthn\RegisteredCredential $credential): void

Persist a newly registered credential, keyed by its id.

Parameters

Parameters of register()
NameTypeDescription
$credentialMilpa\Auth\WebAuthn\RegisteredCredential

PasskeyCredentialStore::find()

abstract public function find(string $credentialId): ?Milpa\Auth\WebAuthn\RegisteredCredential

The credential with this id, or null when the house never registered it.

Parameters

Parameters of find()
NameTypeDescription
$credentialIdstring

PasskeyCredentialStore::updateSignCount()

abstract public function updateSignCount(string $credentialId, int $signCount): void

Advance a credential's stored sign counter after a successful assertion.

Parameters

Parameters of updateSignCount()
NameTypeDescription
$credentialIdstring
$signCountint