WebAuthnAuthenticationResult

public struct WebAuthnAuthenticationResult : Equatable, Hashable, Sendable

WebAuthn authentication result from a passkey ceremony.

Contains the complete attestation data required to verify biometric or security-key authentication. The signature field is in DER format; normalize it to a 64-byte compact low-S signature via SmartAccountUtils.normalizeSignature before on-chain submission.

  • WebAuthn credential identifier (raw bytes).

    Declaration

    Swift

    public let credentialId: Data
  • Raw authenticator data bytes from the WebAuthn assertion ceremony.

    Declaration

    Swift

    public let authenticatorData: Data
  • Raw clientDataJSON bytes from the WebAuthn assertion ceremony.

    Declaration

    Swift

    public let clientDataJSON: Data
  • ECDSA signature in DER format produced by the authenticator over the authenticatorData || sha256(clientDataJSON) payload.

    Declaration

    Swift

    public let signature: Data
  • Undocumented

    Declaration

    Swift

    public init(
        credentialId: Data,
        authenticatorData: Data,
        clientDataJSON: Data,
        signature: Data
    )
  • All four Data fields use constant-time byte comparison via Data.constantTimeEquals; see that extension for the timing-attack rationale.

    Declaration

    Swift

    public static func == (lhs: WebAuthnAuthenticationResult, rhs: WebAuthnAuthenticationResult) -> Bool
  • Hashes all four byte fields. Hasher.combine(Data) hashes byte content.

    Declaration

    Swift

    public func hash(into hasher: inout Hasher)