AuthenticatorAttestationResponse: attestationObject 属性

Baseline 已广泛支持

此功能已成熟,并可在多种设备和浏览器版本上运行。自 2021 年 9 月起,所有浏览器均已支持此功能。

安全上下文: 此功能仅在安全上下文(HTTPS)中可用,且支持此功能的浏览器数量有限。

AuthenticatorAttestationResponse 接口的 attestationObject 属性返回一个 ArrayBuffer,其中包含新的公钥,以及使用设备制造时存储在身份验证器中的私钥对整个 attestationObject 的签名。

作为 CredentialsContainer.create() 调用的一部分,身份验证器将为该密钥对创建一个新的密钥对以及一个 attestationObject。生成此证明签名的私钥对应的公钥是众所周知的;但是,对于不同的生态系统(例如 Android 或 TPM 证明),存在各种众所周知的证明公钥链。

解码 CBOR 编码的 ArrayBuffer 后,生成的 JavaScript 对象将包含以下属性:

authData

操作的 身份验证器数据。请注意,在 AuthenticatorAssertionResponse 中,authenticatorData 作为 JavaScript 对象中的一个属性公开(参见 AuthenticatorAssertionResponse.authenticatorData),而在 AuthenticatorAttestationResponse 中,authenticatorDataCBOR 映射中的一个属性。

AuthenticatorAttestationResponseAuthenticatorAssertionResponse 都使用相同的 AuthenticatorAssertionResponse.authenticatorData 字段。在证明中使用时,它包含一个可选字段 attestedCredentialData。在 AuthenticatorAssertionResponse 中使用时,不包含此字段。attestedCredentialData 字段包含 credentialIdcredentialPublicKey

fmt

一个指示证明语句格式的文本字符串。WebAuthn 规范定义了多种格式;但是,其他规范也可以定义格式并在 IANA 注册表中注册。WebAuthn 定义的格式包括:

  • "packed"
  • "tpm"
  • "android-key"
  • "android-safetynet"
  • "fido-u2f"
  • "none"
attStmt

一个由 "fmt" 定义格式的证明语句。目前,请参阅 WebAuthn 规范了解每种格式的详细信息

示例

有关详细示例,请参阅 创建公钥凭证

规范

规范
Web Authentication:访问公钥凭证的 API - 第 3 级
# dom-authenticatorattestationresponse-attestationobject

浏览器兼容性

另见

  • CredentialsContainer.create():用于创建带有加密 challenge 的声明的方法,该声明由身份验证器签名,签名包含在 attStmt 中,并使用指定的 attestation 传输选项。