#! /bin/bash

# Make a certificate/private key pair using a locally generated
# root certificate.
export EASY_RSA="`pwd`"
export OPENSSL="openssl"
export PKCS11TOOL="pkcs11-tool"
export GREP="grep"
export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA`
export KEY_DIR="$EASY_RSA/keys"
export PKCS11_PIN="dummy"
export KEY_SIZE=1024
export CA_EXPIRE=3650
export KEY_EXPIRE=3650
export KEY_COUNTRY="FR"
export KEY_PROVINCE="FR"
export KEY_CITY="Paris"
export KEY_ORG="Cobalt-Lab"
export KEY_EMAIL="me@myhost.mydomain"
export KEY_CNAME=$1
export EASY_RSA="${EASY_RSA:-.}"
"$EASY_RSA/pkitool" $*
