EcdsaParams

We’d love to hear your thoughts on the next set of proposals for the JavaScript language. You can find a description of the proposals here.
Please take two minutes to fill out our short survey.

Web Crypto APIEcdsaParams 字典表示当使用 ECDSA 算法时,应作为 algorithm 参数传递给 SubtleCrypto.sign()SubtleCrypto.verify() 的对象。

实例属性

name

一个字符串。应设置为 ECDSA

hash

一个字符串或一个包含单个名为 name 且具有字符串值的属性的对象。表示要使用的摘要函数的字符串。可以是以下值之一:

  • SHA-256:选择 SHA-256 算法。
  • SHA-384:选择 SHA-384 算法。
  • SHA-512:选择 SHA-512 算法。

警告: 此处也支持 SHA-1,但 SHA-1 算法被认为是脆弱的,应该不再使用。

示例

规范

Specification
Web Cryptography API
# SubtleCrypto-method-sign
Web Cryptography API
# SubtleCrypto-method-verify

浏览器兼容性

支持在 SubtleCrypto.sign()SubtleCrypto.verify() 方法中使用“ECDSA”算法的浏览器将会支持此类型。

api.SubtleCrypto.sign

api.SubtleCrypto.verify

参见