Created
August 23, 2013 14:06
-
-
Save dweinstein/6319690 to your computer and use it in GitHub Desktop.
little script to generate client cert (based on http://qemu.weilnetz.de/qemu-doc.html#vnc_005fsecurity)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
client_dir=client-$1 | |
if [ -z $1 ]; then | |
echo "must pass the client name" | |
exit | |
fi | |
if [ ! -d $1 ]; then | |
mkdir $client_dir | |
fi | |
pushd . | |
cd $client_dir | |
read -p "edit the client info template, ok?" | |
vi ../client.info | |
certtool --sec-param high \ | |
--generate-privkey > client-key.pem | |
certtool --generate-certificate \ | |
--load-ca-certificate ../ca-cert.pem \ | |
--load-ca-privkey ../ca-key.pem \ | |
--load-privkey client-key.pem \ | |
--template ../client.info \ | |
--outfile client-cert.pem | |
cp ../server-cert.pem . | |
popd | |
zip -r ${client_dir}.zip ${client_dir} | |
echo "done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment