AuthenticatorAttestationResponse: getAuthenticatorData() 方法

Baseline 2023
新推出

自 ⁨2023 年 10 月⁩ 以來,此功能已在最新裝置和瀏覽器版本中得到支援。此功能可能無法在舊裝置或瀏覽器上執行。

安全上下文: 此功能僅在安全上下文(HTTPS)中可用,且支援此功能的瀏覽器數量有限。

AuthenticatorAttestationResponse 介面的 getAuthenticatorData() 方法返回一個 ArrayBuffer,其中包含 AuthenticatorAttestationResponse.attestationObject 屬性中的身份驗證器資料。

這是一個方便函式,用於輕鬆訪問身份驗證器資料,而無需編寫額外的解析程式碼從 attestationObject 中提取它。

語法

js
getAuthenticatorData()

引數

無。

返回值

一個 ArrayBuffer,其 ArrayBuffer.byteLength 至少為 37 位元組,其中包含 身份驗證器資料 中解釋的資料結構。

這將等同於 AuthenticatorAttestationResponse.attestationObject 屬性中包含的身份驗證器資料。

示例

有關詳細示例,請參閱 建立公鑰憑證

規範

規範
Web Authentication:訪問公鑰憑證的 API - 第 3 級
# dom-authenticatorattestationresponse-getauthenticatordata

瀏覽器相容性