公钥证书 :Linux常用的为crt后缀的证书。Windows上常用的为cer后缀的证书。
生成CA证书(自签名的根证书)
一、生成私钥: 生成des3加密的私钥private.pem(1024/2048位的密钥)
[root@iZ2zeddfx87fw4m4dlxu8dZ certs]# openssl genrsa -des3 -out private.pem 2048
Generating RSA private key, 2048 bit long modulus
......................+++
................+++
e is 65537 (0x10001)
Enter pass phrase for private.pem: #输入自定义口令
Verifying - Enter pass phrase for private.pem: #输入确认自定义口令
[root@iZ2zeddfx87fw4m4dlxu8dZ certs]# ll
total 4
-rw-r--r-- 1 root root 1751 Jul 20 14:50 private.pem #最终生成的私钥文件
二、生成公钥(公钥可以根据私钥进行推算出来,反之则不行)
[root@iZ2zeddfx87fw4m4dlxu8dZ certs]# openssl rsa -in private.pem -pubout -out public.pem
Enter pass phrase for private.pem: #输入上面的访问密钥的口令
writing RSA key
[root@iZ2zeddfx87fw4m4dlxu8dZ certs]# ll
total 8
-rw-r--r-- 1 root root 1751 Jul 20 14:50 private.pem
-rw-r--r-- 1 root root 451 Jul 20 14:52 public.pem #公钥文件
三、生成证书:生成X509格式的CA自签名证书(有效期一年)
[root@iZ2zeddfx87fw4m4dlxu8dZ certs]# openssl req -new -x509 -key private.pem -out ca.crt -days 3650
Enter pass phrase for private.pem:
You are about to be asked to enter information that will be incorporated
into your certificate

该文详细介绍了在Linux环境下生成自签名的CA证书以及根据此CA证书颁发用户证书的步骤,包括生成私钥、公钥、证书请求文件(CSR)以及最终的用户证书,涉及openssl工具的使用和证书信息填写。
最低0.47元/天 解锁文章
2698

被折叠的 条评论
为什么被折叠?



