File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 2
2
Generate a couple private and public key:
3
3
4
4
``` bash
5
- openssl req -newkey rsa:2048 -nodes -keyout privkey.pem -x509 -days 365 -out public.pem
5
+ openssl req -newkey rsa:2048 -sha1 -nodes -keyout private.pem -x509 -days 1095 -out server.pub -subj " /C=US/ST=MyDept/L=m=MyCity/O=myCompany/OU=IT/CN=mydomain.com"
6
+ ```
7
+
8
+ Extract a pkcs7 cert file:
9
+
10
+ ``` bash
11
+ openssl crl2pkcs7 -nocrl -certfile server.pub -out cert.p7b
12
+ ```
13
+
14
+ Extract a smine cert file from pkcs7:
15
+
16
+ ``` bash
17
+ openssl pkcs7 -in cert.p7b -out smime-cert.pem -print_certs
6
18
```
7
19
8
20
Merge them into a p12 file:
9
21
10
22
``` bash
11
- openssl pkcs12 -inkey privkey.pem -in public .pem -export -out server.p12
23
+ openssl pkcs12 -inkey cert.p7b -in smime-cert .pem -inkey private.pem -in server.pub - export -out server.p12 -nodes -passout pass:
12
24
```
13
25
14
26
Check your p12 file:
You can’t perform that action at this time.
0 commit comments