root@172-17-218-79 \~\]# **mkdir cert** \[root@172-17-218-79 \~\]# **cd cert/** \[root@172-17-218-79 cert\]# **openssl genrsa -out server.key 1024** Generating RSA private key, 1024 bit long modulus (2 primes) ......+++++ .........................................+++++ e is 65537 (0x010001) \[root@172-17-218-79 cert\]# **openssl req -new -key server.key -out server.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, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) \[AU\]: State or Province Name (full name) \[Some-State\]: Locality Name (eg, city) \[\]: Organization Name (eg, company) \[Internet Widgits Pty Ltd\]: Organizational Unit Name (eg, section) \[\]: Common Name (e.g. server FQDN or YOUR name) \[\]:server Email Address \[\]: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password \[\]: An optional company name \[\]: \[root@172-17-218-79 cert\]# **openssl x509 -req -in server.csr -out server.crt -signkey server.key -days 9999** Signature ok subject=C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = server Getting Private key \[root@172-17-218-79 cert\]# ll total 12 -rw-r--r-- 1 root root 818 Dec 6 15:29 **server.crt** -rw-r--r-- 1 root root 627 Dec 6 15:29 server.csr -rw------- 1 root root 887 Dec 6 15:28 **server.key** 思路: 1. 生成私钥 2. 生成请求文件 3. 签名+x509封装
相关推荐
草履虫建模22 分钟前
在 RuoYi 中接入 3D「园区驾驶舱」:Vue2 + Three.js + Nginx凡间客30 分钟前
Linux防火墙-FirewalldJustin_193 小时前
Linux-Shell编程之sed和awk半桔4 小时前
【Linux手册】消息队列从原理到模式:底层逻辑、接口实战与责任链模式的设计艺术华纳云IDC服务商4 小时前
Linux服务器的系统安全强化超详细教程衍余未了4 小时前
k8s镜像推送到阿里云,使用ctr推送镜像到阿里云Forever_Hopeful4 小时前
【C 语言生成指定范围随机数(整数 + 小数):原理、实现与避坑指南】yiqiqukanhaiba4 小时前
Linux编程笔记1-概念&数据类型&输入输出乌萨奇也要立志学C++5 小时前
【Linux】进程概念(一):从冯诺依曼体系到 PCB 的进程核心解析游九尘5 小时前
服务器都是用的iis, 前端部署后报跨域,不是用同一个服务器 是前端项目的服务器做Nginx转发,还是后端项目的服务器做Nginx转发?