aboutsummaryrefslogtreecommitdiffstats
path: root/generate-key
diff options
context:
space:
mode:
Diffstat (limited to 'generate-key')
-rwxr-xr-xgenerate-key32
1 files changed, 32 insertions, 0 deletions
diff --git a/generate-key b/generate-key
new file mode 100755
index 0000000..d41a90c
--- /dev/null
+++ b/generate-key
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+. ./config
+
+echo 'Today is :'
+date
+echo '(check if the date is correct and press enter)'
+read z
+
+chmod 700 "$GPGHOMEDIR"
+
+echo "Generate key :"
+gpg --homedir "$GPGHOMEDIR" --batch --gen-key "$INPUTDIR/board.batch"
+
+echo "Public key :"
+gpg --homedir "$GPGHOMEDIR" --list-keys
+gpg --homedir "$GPGHOMEDIR" --list-keys --fingerprint > "$PUBDIR/mageia-board-fingerprint.txt"
+gpg --homedir homedir --export -a > "$pubkey"
+
+echo "Secret key :"
+gpg --homedir "$GPGHOMEDIR" --list-secret-keys
+gpg --homedir homedir --export-secret-keys -a > "$seckey"
+
+rm -Rf "$GPGHOMEDIR"
+
+echo "Generate passphrase"
+./random-passphrase > "$passphrase"
+gpg -c --passphrase-file "$passphrase" "$seckey"
+rm -f "$seckey"
+
+#TODO : split secret key using ssss-split
+