extractPublicKey

fun extractPublicKey(registrationResponseJson: String): P256PublicKey

Extracts the P-256 public key coordinates from a WebAuthn registration response JSON.

Return

P256PublicKey with x/y coordinates and compressed form

Parameters

registrationResponseJson

The full JSON from CreatePublicKeyCredentialResponse

Throws

if the public key cannot be extracted