Subversion Repositories ALCASAR

Rev

Rev 1702 | Rev 1830 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1702 Rev 1705
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
# $Id: alcasar-CA.sh 1702 2015-10-15 19:39:50Z richard $
2
# $Id: alcasar-CA.sh 1705 2015-10-20 16:52:33Z richard $
3
 
3
 
4
# alcasar-CA.sh
4
# alcasar-CA.sh
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
#
7
#
Line 180... Line 180...
180
touch $DIR_TMP/index.txt
180
touch $DIR_TMP/index.txt
181
 
181
 
182
# CA key
182
# CA key
183
rm -f $CAKEY
183
rm -f $CAKEY
184
echo "*********CAKEY*********" > $DIR_TMP/openssl-log
184
echo "*********CAKEY*********" > $DIR_TMP/openssl-log
185
openssl genrsa -out $CAKEY  1024 2>> $DIR_TMP/openssl-log
185
openssl genrsa -out $CAKEY  2048 2>> $DIR_TMP/openssl-log
186
 
186
 
187
# CA certificate
187
# CA certificate
188
rm -f $CACERT
188
rm -f $CACERT
189
echo "*********CACERT*********" >> $DIR_TMP/openssl-log
189
echo "*********CACERT*********" >> $DIR_TMP/openssl-log
190
echo "$COUNTRY
190
echo "$COUNTRY
191
$PROVINCE
191
$PROVINCE
192
$LOCATION
192
$LOCATION
193
$ORGANIZATION
193
$ORGANIZATION
194
Certification Authority for $hostname
194
Certification Authority for $hostname
195
ALCASAR-local-CA
195
ALCASAR-local-CA
196
$CAMAIL" |
196
$CAMAIL" | 
197
	openssl req -config $DIR_TMP/ssl.conf -new -x509 -days $CACERT_LIFETIME -key $CAKEY -out $CACERT 2>> $DIR_TMP/openssl-log
197
openssl req -config $DIR_TMP/ssl.conf -new -x509 -sha256 -days $CACERT_LIFETIME -key $CAKEY -out $CACERT 2>> $DIR_TMP/openssl-log
198
 
198
 
199
# Server key
199
# Server key
200
rm -f $SRVKEY	
200
rm -f $SRVKEY	
201
echo "*********SRVKEY*********" >> $DIR_TMP/openssl-log
201
echo "*********SRVKEY*********" >> $DIR_TMP/openssl-log
202
openssl genrsa -out $SRVKEY 1024 2>> $DIR_TMP/openssl-log
202
openssl genrsa -out $SRVKEY 2048 2>> $DIR_TMP/openssl-log
203
 
203
 
204
# Server certificate "request"
204
# Server certificate "request"
205
echo "*********SRVRQST*********" >> $DIR_TMP/openssl-log
205
echo "*********SRVRQST*********" >> $DIR_TMP/openssl-log
206
echo "$COUNTRY
206
echo "$COUNTRY
207
$PROVINCE
207
$PROVINCE