Skip to content

Commit d678067

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 633cd37 + 892f6f0 commit d678067

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/certificate.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,25 @@
22
Generate a couple private and public key:
33

44
```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
618
```
719

820
Merge them into a p12 file:
921

1022
```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:
1224
```
1325

1426
Check your p12 file:

0 commit comments

Comments
 (0)