summaryrefslogtreecommitdiff
path: root/tools/create-key.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/create-key.sh')
-rwxr-xr-xtools/create-key.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/create-key.sh b/tools/create-key.sh
index 9d29c86..e54b56b 100755
--- a/tools/create-key.sh
+++ b/tools/create-key.sh
@@ -1,4 +1,10 @@
#!/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