我是靠谱客的博主 会撒娇航空,这篇文章主要介绍用gmssl命令生成sm2证书,现在分享给大家,希望可以做个参考。

1、生成SM2私钥及证书请求
 
  1. gmssl ecparam -genkey -name sm2p256v1 -text -out user.key

  2. gmssl req -new -key user.key -out user.req

2、用私钥对csr进行自签名
gmssl x509 -req -days 3650 -sm3 -in user.req -signkey user.key -out user.crt
3、把crt转cer
gmssl x509 -inform pem -in user.crt -outform der -out user.cer
4、查看证书内容:
petcrt格式(begin..end格式base64):
gmssl x509 -in user.crt -text -noout
 
dercer(hex)格式:

gmssl x509 -in user.cer -inform der -text -noout

参考:
http://gmssl.org/docs/quickstart.html
http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=29199121&id=4424058
http://www.cnblogs.com/StephenWu/p/6791714.html
http://www.cnblogs.com/guogangj/p/4118605.html

最后

以上就是会撒娇航空最近收集整理的关于用gmssl命令生成sm2证书的全部内容,更多相关用gmssl命令生成sm2证书内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(127)

评论列表共有 0 条评论

立即
投稿
返回
顶部