Open xhaoxiong opened 2 years ago
<script> function encrypt() { //公钥,16进制格式,由后端生成 var pubkeyHex = "04813d4d97ad31bd9d18d785f337f683233099d5abed09cb397152d50ac28cc0ba43711960e811d90453db5f5a9518d660858a8d0c57e359a8bf83427760ebcbba"; var encryptData = sm2Encrypt("SM2 Encryption Test", pubkeyHex, 0); console.log(encryptData); } </script>
初始化CryptSM2时,给私钥赋值空字符串就可以了,可参考 关于登录接口突然失效了这档子事 这篇博文