guanzhi / GmSSL

支持国密SM2/SM3/SM4/SM9/SSL的密码工具箱
http://gmssl.org
Apache License 2.0
5.17k stars 1.67k forks source link

v3.0版本有命令行可以生成根证书,服务器证书,客户端证书吗 #1239

Closed wahjrzd closed 2 years ago

zxm256 commented 2 years ago

可以参考如下命令 gmssl sm2keygen -pass 123456 -out cakey.pem -pubout capubkey.pem gmssl certgen -C CN -ST Beijing -L Haidian -O PKU -OU CS -CN CA -days 365 -key cakey.pem -pass 123456 -out cacert.pem gmssl certparse -in cacert.pem

gmssl sm2keygen -pass 123456 -out signkey.pem -pubout signpubkey.pem gmssl reqgen -C CN -ST Beijing -L Haidian -O PKU -OU CS -CN Alice -days 365 -key signkey.pem -pass 123456 -out signreq.pem gmssl reqsign -in signreq.pem -days 365 -key_usage digitalSignature -cacert cacert.pem -key cakey.pem -pass 123456 -out signcert.pem gmssl certparse -in signcert.pem

gmssl sm2keygen -pass 123456 -out enckey.pem -pubout encpubkey.pem gmssl reqgen -C CN -ST Beijing -L Haidian -O PKU -OU CS -CN Alice -days 365 -key enckey.pem -pass 123456 -out encreq.pem gmssl reqsign -in encreq.pem -days 365 -key_usage digitalSignature -cacert cacert.pem -key cakey.pem -pass 123456 -out enccert.pem gmssl certparse -in enccert.pem

wahjrzd commented 2 years ago

可以参考如下命令 gmssl sm2keygen -pass 123456 -out cakey.pem -pubout capubkey.pem gmssl certgen -C CN -ST Beijing -L Haidian -O PKU -OU CS -CN CA -days 365 -key cakey.pem -pass 123456 -out cacert.pem gmssl certparse -in cacert.pem

gmssl sm2keygen -pass 123456 -out signkey.pem -pubout signpubkey.pem gmssl reqgen -C CN -ST Beijing -L Haidian -O PKU -OU CS -CN Alice -days 365 -key signkey.pem -pass 123456 -out signreq.pem gmssl reqsign -in signreq.pem -days 365 -key_usage digitalSignature -cacert cacert.pem -key cakey.pem -pass 123456 -out signcert.pem gmssl certparse -in signcert.pem

gmssl sm2keygen -pass 123456 -out enckey.pem -pubout encpubkey.pem gmssl reqgen -C CN -ST Beijing -L Haidian -O PKU -OU CS -CN Alice -days 365 -key enckey.pem -pass 123456 -out encreq.pem gmssl reqsign -in encreq.pem -days 365 -key_usage digitalSignature -cacert cacert.pem -key cakey.pem -pass 123456 -out enccert.pem gmssl certparse -in enccert.pem

大致明白了^-^