安全上下文
此特征只可用于 安全上下文 (HTTPS),在某些或所有 支持浏览器 .

attestationObject 特性为 AuthenticatorAttestationResponse interface returns an ArrayBuffer containing the new public key, as well as signature over the entire attestationObject with a private key that is stored in the authenticator when it is manufactured.

As part of the CredentialsContainer.create() call, an authenticator will create a new keypair as well as an attestationObject for that keypair. The public key that corresponds to the private key that has created the attestation signature is well known; however, there are various well known attestation public key chains for different ecosystems (for example, Android or TPM attestations).

句法

attestObj = authenticatorAttestationResponse.attestationObject
					

特性

After decoding the CBOR encoded ArrayBuffer , the resulting JavaScript object will contain the following properties:

authData
如同 AuthenticatorAssertionResponse.authenticatorData . Note that in AuthenticatorAssertionResponse authenticatorData is exposed as a property in a JavaScript object while in AuthenticatorAttestationResponse authenticatorData is a property in a CBOR map.
The same AuthenticatorAssertionResponse.authenticatorData field is used by both AuthenticatorAttestationResponse 和通过 AuthenticatorAssertionResponse . When used in attestation, it contains an optional field, attestedCredentialData . This field is not included when used in the AuthenticatorAssertionResponse . The attestedCredentialData field contains the credentialId and credentialPublicKey .
fmt
A text string that indicates the format of the attStmt. The WebAuthn specification defines a number of formats ; however, formats may also be defined in other specifications and registered in an IANA registry . Formats defined by WebAuthn are:
  • "packed"
  • "tpm"
  • "android-key"
  • "android-safetynet"
  • "fido-u2f"
  • "none"
attStmt
A an attestation statement that is of the format defined by "fmt" . For now, see the WebAuthn specification for details on each format .

范例

var publicKey = {
  challenge: /* from the server */,
  rp: {
    name: "Example CORP",
    id  : "login.example.com"
  },
  user: {
    id: new Uint8Array(16),
    name: "jdoe@example.com",
    displayName: "John Doe"
  },
  pubKeyCredParams: [
    {
      type: "public-key",
      alg: -7
    }
  ]
};
navigator.credentials.create({ publicKey })
  .then(function (newCredentialInfo) {
    var attestationObj = newCredentialInfo.response.attestationObject;
    // This will be a CBOR encoded ArrayBuffer
    // Do something with the response
    // (sending it back to the relying party server maybe?)
  }).catch(function (err) {
     console.error(err);
  });
					

规范

规范 状态 注释
Web Authentication: An API for accessing Public Key Credentials Level 1
The definition of 'attestationObject' in that specification.
推荐 初始定义。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
attestationObject Chrome 67
67
65 Disabled
Only supports USB U2F tokens.
Disabled ). To change preferences in Chrome, visit
Edge 18 Firefox 60
60
Only supports USB U2F tokens.
IE No Opera No Safari 13 WebView Android 70 Chrome Android 70 Firefox Android 60
60
Only supports USB U2F tokens.
Opera Android No Safari iOS 13.3 Samsung Internet Android 10.0

图例

完整支持

完整支持

不支持

不支持

见实现注意事项。

用户必须明确启用此特征。

用户必须明确启用此特征。

另请参阅

元数据

  • 最后修改:
  1. Web 身份验证 API
  2. AuthenticatorAttestationResponse
  3. 特性
    1. attestationObject
  4. 方法
    1. getTransports()
  5. Related pages for Web Authentication API
    1. AuthenticatorAssertionResponse
    2. AuthenticatorResponse
    3. CredentialsContainer
    4. PublicKeyCredential

版权所有  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1