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:父介面