1 |
dpavlin |
2 |
#! /bin/sh |
2 |
|
|
|
3 |
|
|
#================================================================ |
4 |
|
|
# gencert |
5 |
|
|
# Generate a self signed certificate |
6 |
|
|
#================================================================ |
7 |
|
|
|
8 |
|
|
|
9 |
|
|
# set variables |
10 |
|
|
LANG=C ; export LANG |
11 |
|
|
LC_ALL=C ; export LC_ALL |
12 |
|
|
name="selfish" |
13 |
|
|
|
14 |
|
|
|
15 |
|
|
# generate the private key |
16 |
|
|
openssl genrsa -out "$name.key" 1024 |
17 |
|
|
|
18 |
|
|
|
19 |
|
|
# generate the certificate signing request |
20 |
|
|
openssl req -new -days 1456 -key "$name.key" -out "$name.csr" <<__EOF |
21 |
|
|
JP |
22 |
|
|
Kanagawa |
23 |
|
|
Yokohama |
24 |
|
|
Hyper Estraier |
25 |
|
|
Development |
26 |
|
|
localhost.localdomain |
27 |
|
|
mikio@users.sourceforge.net |
28 |
|
|
|
29 |
|
|
|
30 |
|
|
__EOF |
31 |
|
|
|
32 |
|
|
|
33 |
|
|
# generate the self signed certificate |
34 |
|
|
openssl x509 -in "$name.csr" -out "$name.crt" -req -signkey "$name.key" -days 1456 |
35 |
|
|
|
36 |
|
|
|
37 |
|
|
# exit normally |
38 |
|
|
exit 0 |
39 |
|
|
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
# END OF FILE |