window.crypto.subtle.digest(
{
name: "SHA-256",
},
new Uint8Array([1,2,3,4])
)
.then...(function(hash){
console.log(new Uint8Array(hash));
})
.catch(function(err){
console.error(err...256"}, //签名时的hash算法
//RSA参数
modulusLength: 2048, //私钥长度
publicExponent: new Uint8Array...)
}
function base64StringToArrayBuffer(b64str) {
var byteStr = atob(b64str)
var bytes = new Uint8Array...RSASSA-PKCS1-v1_5",
},
privateKey,
data
)
.then(function(signature){
console.log(new Uint8Array