WebAuthnRegistrationResult

data class WebAuthnRegistrationResult(val credentialId: ByteArray, val publicKey: ByteArray, val attestationObject: ByteArray, val transports: List<String>? = null, val deviceType: String? = null, val backedUp: Boolean? = null)

WebAuthn registration result from a passkey creation ceremony.

Contains the public key and credential information needed to deploy a smart account contract, along with optional metadata about the authenticator and passkey characteristics.

Primary path: Providers should populate publicKey directly with the 65-byte uncompressed secp256r1 key (0x04 prefix + X + Y). Most WebAuthn APIs expose the public key via response.getPublicKey() or equivalent.

Fallback: If the provider cannot extract the public key directly, it can pass the raw bytes from the WebAuthn API in publicKey and supply attestationObject. Callers can then use SmartAccountUtils.extractPublicKeyFromRegistration which supports three extraction strategies: direct validation, authenticator data parsing, and attestation object pattern matching.

Constructors

Link copied to clipboard
constructor(credentialId: ByteArray, publicKey: ByteArray, attestationObject: ByteArray, transports: List<String>? = null, deviceType: String? = null, backedUp: Boolean? = null)

Properties

Link copied to clipboard

Raw attestation object from WebAuthn registration. Always provided by the WebAuthn ceremony. Used for public key extraction when the platform returns the key in COSE or SPKI encoding rather than as a raw 65-byte uncompressed key.

Link copied to clipboard

Whether the passkey is backed up or synced to a cloud provider. When true, the credential is available across the user's devices. Corresponds to the credentialBackedUp flag in the WebAuthn authenticator data.

Link copied to clipboard

The WebAuthn credential identifier (raw bytes)

Link copied to clipboard

Authenticator device type: "singleDevice" for hardware security keys or "multiDevice" for synced/cloud-backed passkeys. Corresponds to the credentialDeviceType field in the WebAuthn authenticator data flags.

Link copied to clipboard

Uncompressed secp256r1 public key (65 bytes, starting with 0x04). This is the primary extraction path. If the platform WebAuthn API wraps the key in COSE/SPKI encoding, pass the raw bytes and use SmartAccountUtils.extractPublicKeyFromRegistration for extraction with fallback strategies.

Link copied to clipboard

Authenticator transport hints indicating how the browser can communicate with the authenticator (e.g., "usb", "nfc", "ble", "internal"). Used when constructing allowCredentials for future authentication ceremonies.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Custom equals implementation that properly compares ByteArray fields.

Link copied to clipboard
open override fun hashCode(): Int

Custom hashCode implementation that properly handles ByteArray fields.