~]# wget https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 -O /usr/bin/cfssl
~]# wget https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64 -O /usr/bin/cfssl-json
~]# wget https://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64 -O /usr/bin/cfssl-certinfo
~]# chmod +x /usr/bin/cfssl*
~]# cd /opt/
opt]# mkdir certs
opt]# cd certs/
certs]# vi ca-csr.json #ca证书申请文件
{
"CN": "OldboyEdu",
"hosts": [
],
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "CN",
"ST": "beijing",
"L": "beijing",
"O": "od",
"OU": "ops"
}
],
"ca": {
"expiry": "175200h"
}
}
certs]# cfssl gencert -initca ca-csr.json | cfssl-json -bare ca #生成CA根证书与私钥
[root@test-operator certs]# ll | grep ca
-rw-r--r-- 1 root root 836 Feb 1 00:19 ca-config.json
-rw-r--r-- 1 root root 993 Jan 31 08:09 ca.csr
-rw-r--r-- 1 root root 328 Jan 31 08:09 ca-csr.json
-rw------- 1 root root 1675 Jan 31 08:09 ca-key.pem #ca根证书私钥
-rw-r--r-- 1 root root 1346 Jan 31 08:09 ca.pem #ca根证书
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。