ExSwan.AttestationStatement (exswan v0.1.0)

View Source

Handles validation of WebAuthn attestation statements.

This module provides validation for different attestation statement formats according to the WebAuthn specification, including:

  • none - No attestation statement
  • packed - Self attestation or full attestation with certificate chain
  • fido-u2f - FIDO U2F attestation statement format

Each format has specific validation requirements and trust models.

Summary

Functions

Validates an attestation statement based on its format.

Functions

verify(unsupported_format, att_stmt, auth_data, client_data_hash)

@spec verify(String.t(), map(), binary(), binary()) :: :ok | {:error, atom()}

Validates an attestation statement based on its format.

Parameters

  • fmt - Attestation statement format identifier
  • att_stmt - Attestation statement map
  • auth_data - Raw authenticator data bytes
  • client_data_hash - SHA256 hash of client data JSON

Returns

  • :ok - Attestation statement is valid
  • {:error, reason} - Validation failed

Examples

{:ok} = ExSwan.AttestationStatement.verify("none", %{}, auth_data, client_data_hash)