赞
踩
#获取曲线参数 openssl ecparam -list_curves #生成SM2的密钥 openssl ecparam -genkey -name SM2 -text -out Root.key #生成证书请求文件 openssl req -config /etc/pki/tls/openssl.cnf -key Root.key -new -out Root.req #生成证书 openssl x509 -req -days 3650 -sm3 -in Root.req -signkey Root.key -out RootCA.crt #查看DER证书 openssl x509 -in RootCA.crt -text -noout openssl x509 -in /home/admin/user_data/cert/strongbox/ca.cer -inform DER -text
#生成私钥
openssl ecparam -genkey -name SM2 -text -out Server.key
#证书请求
openssl req -new -key Server.key -subj /C=CN/CN=cmq1 -out Server.req
#签发证书
openssl x509 -req -sm3 -days 3650 -CA RootCA.crt -CAkey Root.key -CAcreateserial -in Server.req -out ServerCA.crt
#证书验证
openssl verify -CAfile RootCA.crt ServerCA.crt
#查看证书
openssl x509 -in ServerCA.crt -text -noout
#服务端
openssl s_server -accept 443 -key Server.key -cert ServerCA.crt -dkey Server.key -dcert ServerCA.crt -CAfile RootCA.crt -msg -debug
#客户端
openssl s_client -connect 127.0.0.1:443 -key Client.key -cert ClientCA.crt -CAfile RootCA.crt -msg -debug
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。