From dea6bf757aa9a875eab35b2b650412e7605f1308 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Wed, 12 Feb 2003 17:48:37 +0000 Subject: CVS moved to erdgeist.org --- vchat-keygen | 156 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100755 vchat-keygen (limited to 'vchat-keygen') diff --git a/vchat-keygen b/vchat-keygen new file mode 100755 index 0000000..08c3b6e --- /dev/null +++ b/vchat-keygen @@ -0,0 +1,156 @@ +#!/bin/sh + +# +# vchat-client - alpha version +# vchat-keygen - generate keypair for SSL with anon CA +# +# Copyright (C) 2001 Andreas Kotes +# +# This program is free software. It can be redistributed and/or modified, +# provided that this copyright notice is kept intact. This program is +# distributed in the hope that it will be useful, but without any warranty; +# without even the implied warranty of merchantability or fitness for a +# particular purpose. In no event shall the copyright holder be liable for +# any direct, indirect, incidental or special damages arising in any way out +# of the use of this software. +# + +# where do we want to store the key? +KEYBASE=$1 +if [ "x$KEYBASE" = "x" ] ; then + KEYBASE=$HOME/.vchat +fi + +# no key? generate one ... +if [ ! -e $KEYBASE.key ]; then + echo "vchat-keygen: generating RSA key $KEYBASE.key" + echo "vchat-keygen: please set passphrase for local security" + umask 0077 + openssl genrsa -des3 -out $KEYBASE.key 2048 +else + echo "vchat-keygen: private key $KEYBASE.key exists" +fi + +# no certificate? dump anonymous CA to disk. +if [ ! -e $KEYBASE.cert ]; then + if [ ! -e $KEYBASE.ca.key ]; then + echo "vchat-keygen: saving CA key to $KEYBASE.ca.key" + cat >$KEYBASE.ca.key <$KEYBASE.ca.crt <$KEYBASE.ca.conf <$KEYBASE.ca.db.index + echo 00 >$KEYBASE.ca.db.serial + fi + if [ ! -e $KEYBASE.csr ]; then + if [ ! -e $KEYBASE.ca.keyconf ]; then + echo "vchat-keygen: generating config-file for self-signing $KEYBASE.ca.keyconf" + cat >$KEYBASE.ca.keyconf <