AuthenticatorAttestationResponse
Baseline 广泛可用 *
AuthenticatorAttestationResponse 接口是 Web Authentication API 的一部分,是 WebAuthn 凭证注册的结果。它包含服务器执行 WebAuthn 声明所需的有关凭证的信息,例如其凭证 ID 和公钥。
一个 AuthenticatorAttestationResponse 对象实例可以在成功调用 CredentialsContainer.create() 返回的 PublicKeyCredential 对象的 response 属性中找到。
此接口继承自 AuthenticatorResponse。
注意: 此接口仅限于顶层上下文。在 <iframe> 元素内使用其功能不会产生任何效果。
实例属性
也继承了其父接口 AuthenticatorResponse 的属性。
AuthenticatorAttestationResponse.attestationObject只读-
一个
ArrayBuffer,包含认证器生成的新密钥对的认证器数据和证明声明。 AuthenticatorResponse.clientDataJSON只读-
继承自
AuthenticatorResponse,此属性包含从浏览器传递给认证器以生成此凭证的数据的 JSON 兼容序列化——即,当使用publicKey选项调用CredentialsContainer.create()时。这些数据包含来自传递给create()调用的选项的一些信息,以及一些由浏览器控制的信息。
实例方法
AuthenticatorAttestationResponse.getAuthenticatorData()-
返回一个
ArrayBuffer,其中包含AuthenticatorAttestationResponse.attestationObject属性中的认证器数据。 AuthenticatorAttestationResponse.getPublicKey()-
返回一个
ArrayBuffer,其中包含新凭证的 DERSubjectPublicKeyInfo(参见 Subject Public Key Info),如果不可用则返回null。 AuthenticatorAttestationResponse.getPublicKeyAlgorithm()-
返回一个数字,该数字等于一个 COSE 算法标识符,表示用于新凭证的加密算法。
AuthenticatorAttestationResponse.getTransports()-
返回一个字符串数组,描述了(例如
usb、nfc)被认为与认证器支持的传输方法。如果信息不可用,数组可能为空。
示例
有关详细示例,请参阅 创建公钥凭证。
规范
| 规范 |
|---|
| Web Authentication:访问公钥凭证的 API - 第 3 级 # authenticatorattestationresponse |
浏览器兼容性
加载中…
另见
AuthenticatorAssertionResponse:检索现有凭证时响应类型的接口AuthenticatorResponse:父接口