Add signer backend

This commit adds a simple go backend calling openssl ca to sign CRS
coming from the client. The JavaScript code in src/index.html has been
extended to send requests to the sign endpoint and display the resulting
certificate in a separate div element.

A script setup_example_ca.sh and an openssl configuration file ca.cnf
has been added to allow quick setup of a simple example CA.
This commit is contained in:
Jan Dittberner 2020-11-30 00:08:05 +01:00
parent c751c51713
commit 5c3f0ea942
6 changed files with 233 additions and 43 deletions

11
setup_example_ca.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/sh
if [ ! -d "exampleca" ]; then
mkdir -p exampleca/newcerts
touch exampleca/index.txt
umask 077
mkdir exampleca/private
openssl req -new -x509 -keyout exampleca/private/ca.key.pem -out exampleca/ca.crt.pem -days 3650 \
-subj "/CN=Example CA" -nodes -newkey rsa:3072 -addext "basicConstraints=critical,CA:true,pathlen:0"
chmod +r exampleca/ca.crt.pem
fi