Can revoke/generate server certiticate in admin interface

This commit is contained in:
nemunaire 2014-11-20 18:04:39 +01:00
commit 4d1424b29b
6 changed files with 122 additions and 55 deletions

View file

@ -1,10 +1,12 @@
#!/bin/sh
if [[ -z "${TOP_DIR}" ]]; then
cd $(dirname "$0")
if [ -z "${TOP_DIR}" ]; then
TOP_DIR=pki
fi
if [[ -z "${OPENSSL_CONF}" ]]; then
if [ -z "${OPENSSL_CONF}" ]; then
OPENSSL_CONF=openssl.cnf
fi
@ -16,24 +18,24 @@ DAYS=2
if [ -z "$PS1" ]
then
GREEN="<font color=green>"
RED="<font color=red>"
COLOR_RST="</font>"
BOLD="<strong>"
END_BOLD="</strong>"
ECHO_OPTS=""
else
GREEN="\033[1;32m"
RED="\033[1;31m"
COLOR_RST="\033[0m"
BOLD=""
END_BOLD=""
ECHO_OPTS="-e"
else
GREEN="<font color=green>"
RED="<font color=red>"
COLOR_RST="</font>"
BOLD="<strong>"
END_BOLD="</strong>"
ECHO_OPTS=""
fi
usage()
{
echo "Usage: $0 (-newca|-newserver|-newclient NAME|-revoke NAME|-gencrl)"
echo "Usage: $0 (-newca|-newserver|-revokeserver|-newclient NAME|-revoke NAME|-gencrl)"
exit 1
}
@ -71,7 +73,7 @@ OUTPUT=$(mktemp)
case $1 in
"-newca" )
echo -n $ECHO_OPTS "${GREEN}Create the directories, take care this will delete"
echo $ECHO_OPTS "the old directories ${COLOR_RST}"
echo $ECHO_OPTS " the old directories ${COLOR_RST}"
# sleep 1; echo -n "1 "; sleep 1; echo -n "2 "; sleep 1; echo "3"
clean "ca"
@ -161,7 +163,7 @@ case $1 in
cat $OUTPUT
exit 4
fi
rm ${TOP_DIR}/server.crt ${TOP_DIR}/server.key
rm server.crt server.key
gen_crl
;;