From 0572e707c5269340c91be384275b26c8274ba223 Mon Sep 17 00:00:00 2001 From: Alexander Vdolainen Date: Thu, 21 Jan 2016 06:48:24 +0200 Subject: [PATCH] Added simple script to create x.509 certificates to run with examples and fun faster. --- scripts/create-x509-example.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 scripts/create-x509-example.sh diff --git a/scripts/create-x509-example.sh b/scripts/create-x509-example.sh new file mode 100755 index 0000000..a8e1ca5 --- /dev/null +++ b/scripts/create-x509-example.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Libsxmp i.e. Secure X (for 10) Message Passing library +# +# This script generates CA primary certificates, mostly used +# by examples and fun. +# + +OPENSSL=/usr/bin/openssl + + +$OPENSSL genrsa -out rootCA.key 2048 + +$OPENSSL req -x509 -new -nodes -key rootCA.key -days 8096 -out rootCA.pem + +# make a compound +cat rootCA.key > rootCA.crt +cat rootCA.pem >> rootCA.crt + +# create a key for the certificate authority daemon +$OPENSSL genrsa -out cadaemon.key 2048 +$OPENSSL req -new -key cadaemon.key -out cadaemon.csr +$OPENSSL x509 -req -in cadaemon.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out cadaemon.pem -days 8096 + +# make a compound +cat cadaemon.key > cadaemon.crt +cat cadaemon.pem >> cadaemon.crt +