8000 readme · flames85/cpp-netlib-demo@cedec62 · GitHub
[go: up one dir, main page]

Skip to content

Commit cedec62

Browse files
author
Unknown
committed
readme
1 parent ebe251e commit cedec62

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

certificate/openssl自签名CA和设备证书.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
```bash
66
openssl genrsa -out ca-key.pem 1024
77
```
8-
+ 因为ca-key非常重要, 给它设置一个密码 (该操作是可选的, 如果这里设置了密码, 凡是使用到ca-key.pem的地方都要输入其密码)
8+
+ 可以为私钥添加密码(该操作可选, 添加完密码后, 凡是使用私钥都需要密码)
99
```bash
1010
openssl genrsa -des3 -out ca-key.pem 1024
11-
设置密码:1234
1211
```
1312
+ 创建证书请求[ca-req.csr]
1413
```bash
@@ -27,7 +26,6 @@ An optional company name []:
2726
+ 自签名[ca-cert.pem]
2827
```bash
2928
openssl x509 -req -in ca-req.csr -out ca-cert.pem -signkey ca-key.pem -days 3650
30-
输入密码:1234
3129
```
3230
+ 将私钥和证书导出成浏览器支持的.p12格式[ca.p12]
3331
```bash
@@ -55,7 +53,6 @@ An optional company name []:
5553
+ 自签署证书 [device-cert.pem]
5654
```bash
5755
openssl x509 -req -in device-req.csr -out device-cert.pem -signkey device-key.pem -CA ca-cert.pem -CAkey ca-key.pem -CAcreateserial -days 3650
58-
输入密码:1234
5956
```
6057
+ 将私钥和证书导出成浏览器支持的.p12格式[device.p12]
6158
```bash
@@ -120,12 +117,13 @@ openssl x509 -req -in client-req.csr -out client-cert.pem -signkey client-key.pe
120117
3. 其他信息可以忽略.
121118

122119
#### 4. 文件使用
120+
```
123121
ca-cert.pem [CA证书, 用于client/server]
124122
server-cert.pem [服务端证书/公钥]
125123
server-key.pem [服务端密钥]
126124
client-cert.pem [客户端证书/公钥]
127125
client-key.pem [客户端密钥]
128-
126+
```
129127
__如果给私钥设置了密码, 如:__
130128
```bash
131129
openssl genrsa -des3 -out server-key.pem 1024

0 commit comments

Comments
 (0)
0