生成一個非加密私鑰
openssl genrsa -out private.key 2048
查看私鑰文件
openssl rsa -in private.key -text
通過私鑰文件生成一個公鑰文件(能夠通過私鑰生成公鑰,無法通過公鑰生成私鑰)
openssl rsa -in private.key -pubout -out public.key
通過私鑰文件生成一個自簽名證書(含公鑰和簽名信息)
openssl req -new -x509 -days 3650 -key private.key -out cert.crt
查看證書明細
openssl x509 -in cert.crt -noout -text
自簽名證書操作步驟:1、生成私鑰,2、通過私鑰生成自簽名證書