欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

linux系统下command证书相关命令

程序员文章站 2022-06-23 11:59:10
linux系统下command证书相关命令 证书相关 openssl req -new -newkey rsa:2048 -nodes -out xxx.csr.pem -keyout x...
linux系统下command证书相关命令 证书相关

openssl req -new -newkey rsa:2048 -nodes -out xxx.csr.pem -keyout xxx.private_key.pem //创建一个新的csr和私钥

openssl req -noout -text -in xxxx.csr.pem //查看csr

openssl req -in xxxx.csr.pem -noout -pubkey -out xxxx.public_key.pem //查看公钥

openssl x509 -req -days 360 -in xxxx.csr.pem -CA xxxx.ca.crt.pem -CAkey xxxx.ca.private_key.pem -CAcreateserial -out xxxx.crt.pem -sha256 //签名csr,生成证书

openssl x509 -text -noout -in xxxx.crt.pem //查看证书

openssl x509 -in xxxx.crt.pem -outform DER -out xxxx.crt.der //证书pem转化成der