tjfoc / gmsm

GM SM2/3/4 library based on Golang (基于Go语言的国密SM2/SM3/SM4算法库)
http://www.wutongchain.com
Apache License 2.0
1.7k stars 573 forks source link

无法解析openssl和gmssl生成的sm2密钥,但是gmssl可以解析gmsm和openssl生成的 #182

Open pfx546746447 opened 1 year ago

pfx546746447 commented 1 year ago

gmsm、openssl、gmssl 我分别生成了三对sm2 密钥

gmssl命令用这三对都可以成功加解密数据

gmsm只能用自己生成的sm2密钥对加解密

其他的就会报错

pfx546746447 commented 1 year ago

报错信息: asn1: structure error: tags don't match (16 vs {class:0 tag:4 length:32 isCompound:false}) {optional:false explicit:false application:false private:false defaultValue: tag: stringType:0 timeType:0 set:false omitEmpty:false} AlgorithmIdentifier @5

fzzf678 commented 11 months ago

同问

deatil commented 8 months ago

可以用下这个,https://github.com/deatil/go-cryptobin/tree/main/cryptobin/sm2 ,对库缺少的部分有完善

wen227 commented 6 months ago

可以用下这个,https://github.com/deatil/go-cryptobin/tree/main/cryptobin/sm2 ,对库缺少的部分有完善

感谢,测试了可用