#!/bin/sh

set -o errexit
set -o nounset

[ -f $1-private.pem ] && { echo "$0: $1-private.pem exists, exiting"; exit 1; }
touch $1-private.pem
chmod 600 $1-private.pem
openssl ecparam -name prime256v1 -genkey -noout -out $1-private.pem
openssl ec -in $1-private.pem -pubout -out $1.pem