Linux
下利?/p>
openssl
生成
SSL
证书步骤
1
、概?/p>
首先要有一?/p>
CA
根证书,然后?/p>
CA
根证书来签发用户证书?/p>
用户进行证书申请:一般先生成一个私钥,然后用私钥生成证书请?/p>
(
证书请求里应含有?/p>
钥信?/p>
)
,再利用证书服务器的
CA
根证书来签发证书?/p>
2
、后缀详解
.key
格式:私有的密钥
.csr
格式?/p>
证书签名请求
(证书请求文件)
?/p>
含有公钥信息?/p>
certificate
signing
request
的缩?/p>
.crt
格式:证书文件,
certificate
的缩?/p>
.crl
格式:证书吊销列表?/p>
Certificate Revocation List
的缩?/p>
.pem
格式:用于导出,导入证书时候的证书的格式,有证书开头,结尾的格?/p>
3
、添?/p>
index.txt
?/p>
serial
文件
cd /etc/pki/CA/
touch /etc/pki/CA/index.txt
touch /etc/pki/CA/serial
echo 01 > /etc/pki/CA/serial
4
?/p>
CA
根证书的生成
4.1
生成
CA
私钥?/p>
.key
?/p>
openssl genrsa -out ca.key 2048
[root@CA]# openssl genrsa -out ca.key 2048
Generating RSA private key, 2048 bit long modulus
.............+++
.....+++
e is 65537 (0x10001)
4.2
生成
CA
证书请求?/p>
.csr
?/p>
openssl req -new -key ca.key -out ca.csr
[root@CA]# openssl req -new -key ca.key -out ca.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,