openssl 命令 生成与吊销证书示例 生成CA证书 客户端证书 服务器证书 用CA签名客户服务器的CSR证书
创始人
2025-01-18 21:34:21
0

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

要使用 OpenSSL 生成和吊销证书,你可以按照以下步骤操作:

1. 生成证书

使用 OpenSSL 生成自签名证书的步骤如下:

生成私钥:
openssl genrsa -out key.pem 2048 
生成证书请求(CSR):
openssl req -new -key key.pem -out csr.pem 
自签名证书:
openssl x509 -req -in csr.pem -signkey key.pem -out cert.pem 

2. 吊销证书

要吊销证书,首先需要创建一个 CRL 文件,然后将要吊销的证书添加到 CRL 中。

生成 CRL:
openssl ca -gencrl -keyfile ca.key -cert ca.crt -out crl.pem 
吊销证书:
openssl ca -revoke cert.pem -keyfile ca.key -cert ca.crt 
更新 CRL:
openssl ca -gencrl -keyfile ca.key -cert ca.crt -out crl.pem 

这些步骤将帮助你生成自签名证书并吊销证书。确保你有适当的权限来执行这些操作,并且按照正确的顺序执行步骤。

执行openssl ca -gencrl -keyfile ca.key -cert ca.crt -out crl.pem 提示错误calling fopen(./demoCA/index.txt, r)

就手工建一个空的demoCA/index.txt
并指定-config cnf/openssl.cnf

又报找不到这个文件./demoCA/crlnumber

新建一个并写入00 保存
再试就OK了。

最终吊销脚本

::生成 CRL: set CERT=KRDF2001012A202002 openssl ca -config cnf/openssl.cnf -gencrl -keyfile ca_root.key -cert ca_root.crt -out %CERT%.crl -passin pass:778899   ::吊销证书: openssl ca -revoke %CERT%.crt -keyfile ca_root.key -cert ca_root.crt -passin pass:778899  ::更新 CRL: openssl ca -gencrl -keyfile ca_root.key -cert ca_root.crt -out %CERT%.crl -passin pass:778899  pause  

相关内容

热门资讯

2分钟德州透视挂!hhpoke... 2分钟德州透视挂!hhpoker开挂教程,德州透视插件,详细教程(有挂功能)1、完成德州透视插件透视...
九分钟开辅助!wepoker辅... 九分钟开辅助!wepoker辅助软件价格(透视底牌)详细辅助程序(本来是真的有挂)1、任何wepok...
9分钟透视插件!hh poke... 9分钟透视插件!hh poker软件,hhpoker是正品吗,详细教程(有挂智能)1、hh poke...
7分钟插件辅助!wepoker... 7分钟插件辅助!wepoker买钻石有用吗(透视底牌)详细辅助插件(果然是有挂)7分钟插件辅助!we...
八分钟作弊实战!hhpoker... 八分钟作弊实战!hhpoker脚本,hhpoker辅助靠谱吗,详细教程(有挂安装)1、完成hhpok...
二分钟苹果版!wepoker有... 二分钟苹果版!wepoker有辅助器吗(透视底牌)详细辅助免费(切实真的是有挂)1、点击下载安装,插...
八分钟破解工具!德州透视hhp... 八分钟破解工具!德州透视hhpoker,hh poker辅助器先试用,详细教程(有挂插件)1、该软件...
二分钟作弊!wepoker私人... 二分钟作弊!wepoker私人局可以透视(透视底牌)详细辅助作弊器(本来真的有挂);暗藏猫腻,小编详...
五分钟外挂!德扑HHpoker... 五分钟外挂!德扑HHpoker有挂吗(透视脚本)详细辅助助手(确实真的是有挂)1、任何ai辅助神器的...
5分钟新号!wepoker透视... 5分钟新号!wepoker透视器免费(透视底牌)详细辅助外挂(确实是真的有挂)1、打开软件启动之后找...