在解析 CBOR 之后attestationObject,我现在正在尝试解析authData.
这包含:
https://w3c.github.io/webauthn/#authenticator-data
- 32 字节,
rpIdHash - 1 个字节,
flags(包括AT和ED标志) - 4字节,
signCount - ? 字节,
attestedCredentialData - ? 字节,
extensions
假设AT标志为真,attestedCredentialData则从字节 37 开始,包含:
https://w3c.github.io/webauthn/#sctn-attested-credential-data
- 16 字节,
aaguid - 2 个字节,
credentialIdLength(字节 53 - 55,在许多实现中都可以看到) - credentialIdLength 字节,
credentialId - ? 字节,
credentialPublicKey
这意味着我可以得到credentialIdLength,并提取credentialId.
但是多久了credentialPublicKey?
我可以读到结尾authData;这就是他们在https://webauthn.guide/上显示的内容:
const publicKeyBytes = authData.slice(55 + credentialIdLength);
但是,如果您回顾一下 authData,它可能会包含extensions这之后的数据(如果ED标志为真)。
我发现 Attestation 概览图对于其中的大部分内容都非常有用: