summaryrefslogtreecommitdiffstats
path: root/scripts/nssdb-lunasa-csr.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/nssdb-lunasa-csr.sh')
-rwxr-xr-xscripts/nssdb-lunasa-csr.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/nssdb-lunasa-csr.sh b/scripts/nssdb-lunasa-csr.sh
new file mode 100755
index 0000000..53afc55
--- /dev/null
+++ b/scripts/nssdb-lunasa-csr.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+OUTPUT=ca_signing.csr
+
+echo -e "y\n\ny\n" | \
+ certutil -R \
+ -d nssdb \
+ -h lunasaDEV \
+ -f lunasa.txt \
+ -s "CN=CA Signing Certificate,O=EXAMPLE" \
+ -z nssdb/noise.bin \
+ -k rsa \
+ -g 2048 \
+ -Z SHA512 \
+ -2 \
+ --keyUsage digitalSignature,nonRepudiation,certSigning,crlSigning,critical \
+ -o ca.csr.der
+
+BtoA ca.csr.der ca.csr.pem
+echo "-----BEGIN NEW CERTIFICATE REQUEST-----" > $OUTPUT
+cat ca.csr.pem >> $OUTPUT
+echo "-----END NEW CERTIFICATE REQUEST-----" >> $OUTPUT
+
+rm ca.csr.der
+rm ca.csr.pem