You need to enable JavaScript to run this app.
导航
sign/verify
最近更新时间:2024.04.09 14:14:16首次发布时间:2023.02.15 19:04:53

介绍

详细定义及用法参见MDN官方文档signverify

用法

数据签名和验签常用于身份识别,鉴权,密钥分发等。

算法

  • RSA:常用算法
  • HMAC
  • RSASSA PKCS1 v1.5
  • RSA PSS
  • ECDSA

示例

async function sign_handle(priv_key, plain) {
 var algorithm = {name: "RSASSA-PKCS1-v1_5"};
 return await crypto.subtle.sign(algorithm, priv_key, plain);
}
async function verify_handle(pub_key, plain, sig) {
 var algorithm = {name: "RSASSA-PKCS1-v1_5"};
 return await crypto.subtle.verify(algorithm, pub_key, sig, plain);
}