Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SM2对中文签名在在线网站验签不过去 #15

Closed
394682817 opened this issue Oct 9, 2024 · 1 comment
Closed

SM2对中文签名在在线网站验签不过去 #15

394682817 opened this issue Oct 9, 2024 · 1 comment

Comments

@394682817
Copy link

const { publicKey, privateKey } = sm2.generateKeyPairHex();

let sigValueHex = sm2.doSignature('SM国密2', privateKey, {
hash: true,
der: true
});

换成英文和阿拉伯数字可以验证通过,中文的会报签名不一致,库里的验签结果显示是true
下面是在线网站
https://tool.hiofd.com/sm2-sign-verify/

Cubelrti added a commit that referenced this issue Oct 10, 2024
@Cubelrti
Copy link
Owner

感谢反馈,

原版对中文的 UTF-8 转 16 进制有一些问题,使用英文或者字节数组时不会出现。

已发布 1.9.3 修复这个问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants