bin=.
path=.
exe=./capt

output=`date '+%Y%m%d%H%M%S'`
rm -rf $output
mkdir $output

tmp_key=key.pem
tmp_public_key=temp_public_key.pem
private_key=prv.pk8
public_key=public.x509.pem

$bin/openssl genrsa -out $output/$tmp_key 1024
$bin/openssl pkcs8 -topk8 -inform PEM -in $output/$tmp_key -outform DER -out $output/$private_key -nocrypt
$bin/openssl rsa -in $output/$tmp_key -pubout -out $output/$tmp_public_key

$bin/openssl req -new -x509 -days 36500 -key $output/$tmp_key -out $output/$public_key  -config $bin/openssl.cnf
rm -f $output/$tmp_key
rm -f $output/$tmp_public_key

