Skip to main content

Module authenticator_data

Module authenticator_data 

Source
Expand description

Authenticator data parsing.

The authenticator data (authData) is a binary structure defined in WebAuthn §6.1. It is produced by the authenticator hardware and carries the RP ID binding, user-presence/verification flags, a sign counter, and (during registration) the new credential’s public key encoded as a COSE_Key.

§Binary layout

Offset   Len   Field
──────   ───   ─────────────────────────────────────────────────
     0    32   rpIdHash   — SHA-256 of the RP ID
    32     1   flags      — bitmask (UP / UV / AT / ED)
    33     4   signCount  — big-endian u32
    37     *   attestedCredentialData (present iff AT flag is set)
             16   aaguid
              2   credentialIdLength  (big-endian u16)
              *   credentialId
              *   credentialPublicKey (CBOR-encoded COSE_Key)
     *     *   extensions (CBOR map, present iff ED flag is set)

Structs§

AttestedCredentialData
Credential data embedded in the authenticator data during registration.
AuthenticatorData
Fully parsed authenticator data.
AuthenticatorFlags
Decoded flags byte from authenticator data.

Enums§

CoseKey
A decoded COSE_Key from the credential’s authenticator data.

Functions§

parse_authenticator_data
Parse the raw authenticator data bytes into an AuthenticatorData.
parse_cose_key
Decode a CBOR-encoded COSE_Key and return it as a CoseKey.