WebAuthnRegistrationResult
public struct WebAuthnRegistrationResult : Equatable, Hashable, Sendable
WebAuthn registration result from a passkey creation ceremony.
Contains the public key and credential information needed to deploy a smart-account contract, plus optional metadata about the authenticator and passkey characteristics.
Primary path: providers populate publicKey directly with the 65-byte uncompressed
secp256r1 key (0x04 || X || Y). Most platform WebAuthn APIs expose the public key via
getPublicKey() or equivalent.
Fallback: if the provider cannot extract the public key directly, supply the raw bytes
in publicKey along with attestationObject. Pass the result to
SmartAccountUtils.extractPublicKeyFromRegistration, which tries direct validation,
authenticator-data parsing, and attestation-object pattern matching in order.
-
WebAuthn credential identifier (raw bytes).
Declaration
Swift
public let credentialId: Data -
Uncompressed secp256r1 public key (65 bytes, starting with
0x04), or the raw bytes returned by the platform WebAuthn API when direct extraction is not possible.Declaration
Swift
public let publicKey: Data -
Raw attestation object from the WebAuthn registration ceremony.
Declaration
Swift
public let attestationObject: Data -
Authenticator transport hints (e.g.
usb,nfc,ble,internal). Optional.Declaration
Swift
public let transports: [String]? -
singleDevicefor hardware security keys ormultiDevicefor synced / cloud-backed passkeys.nilwhen device type cannot be determined.Declaration
Swift
public let deviceType: String? -
Whether the passkey is backed up or synced to a cloud provider.
nilwhen backup state cannot be determined.Declaration
Swift
public let backedUp: Bool? -
Undocumented
Declaration
Swift
public init( credentialId: Data, publicKey: Data, attestationObject: Data, transports: [String]? = nil, deviceType: String? = nil, backedUp: Bool? = nil ) -
The three
Datafields (credentialId,publicKey,attestationObject) use constant-time comparison viaData.constantTimeEquals; optional scalar/list fields use ordinary value equality. See that extension for the timing-attack rationale.Declaration
Swift
public static func == (lhs: WebAuthnRegistrationResult, rhs: WebAuthnRegistrationResult) -> Bool -
Hashes all six fields.
Datafields are hashed by byte content.Declaration
Swift
public func hash(into hasher: inout Hasher)
View on GitHub
Install in Dash