Skip to content

Instantly share code, notes, and snippets.

@lewismarshall
Created April 19, 2017 10:21
Show Gist options
  • Save lewismarshall/3da755cd4ee26f873cc5976cb9fb4dd3 to your computer and use it in GitHub Desktop.
Save lewismarshall/3da755cd4ee26f873cc5976cb9fb4dd3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
function generate_ca() {
if [[ ! -f tests/certs/${1}/ca.key ]]; then
mkdir -p tests/certs/${1}
cfssl gencert -initca tests/certs/ca-csr.json | cfssljson -bare tests/certs/${1}/ca
mv tests/certs/${1}/ca.pem tests/certs/${1}/ca.crt
mv tests/certs/${1}/ca-key.pem tests/certs/${1}/ca.key
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment