duanhongyi / gmssl

a python crypto for sm2/sm3/sm4
MIT License
479 stars 140 forks source link

公私钥怎么生成 #36

Open YiqinXu opened 3 years ago

YiqinXu commented 3 years ago

您好,

我想问一下,除了demo里提供的公私钥,如果我想要自己生成程序能用的公私钥的话,应该怎么办呢。

谢谢

huruzun commented 3 years ago

您好,

我想问一下,除了demo里提供的公私钥,如果我想要自己生成程序能用的公私钥的话,应该怎么办呢。麻烦作者抽空回答下。

谢谢

liaoweiguo commented 2 years ago

openssl ecparam -genkey -name SM2 -out priv.key openssl req -new -x509 -sha256 -key priv.key -out cer.crt -days 3650 -subj '/C=CN/ST=Hubei/L=Hongshan/O=CAD/OU=RND/CN=CAD/emailAddress=laoda@netease.com'

check

openssl x509 -in cer.crt -noout -text