duanhongyi / gmssl

a python crypto for sm2/sm3/sm4
MIT License
488 stars 141 forks source link

sm2加解密时没有进行asn1编码 #84

Open laoyinbi-px opened 11 months ago

laoyinbi-px commented 11 months ago

国密sm2是非对称加密算法,需要对加密后的密文做一次asn1编码

Holy-Shine commented 11 months ago

3.2.2 版本后,sm2增加了asn1支持:

sm2_crypt = sm2.CryptSM2(
     ...,
     asn1=True
)