#!/bin/bash
# 
# ptudor@ptudor.net
# 
# Converts a .pem into a .pks for an IIS5 key import

umask 077

if [ "$1" = "" ]
  then
  echo "  This script requires an argument of the name of the server"
  echo "  this certificate is for. Try again."
  exit 99
fi

echo -en "\nConverting..."
openssl pkcs12 -export -inkey $1/$1-key.pem -in $1/$1-cert.pem -out $1/$1-key.pks -password pass:$1 -name "$1 PKS Certificate"
echo -en "done\n\n"

