/[soft]/gpg/generate-key.sh
ViewVC logotype

Contents of /gpg/generate-key.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 390 - (show annotations) (download) (as text)
Thu Feb 3 12:02:06 2011 UTC (13 years, 2 months ago) by boklm
File MIME type: application/x-sh
File size: 974 byte(s)
encrypt secret key using passphrase
1 #!/bin/sh
2
3 GPGHOMEDIR="./homedir"
4 PUBDIR="./public"
5 PRIVDIR="./private"
6 INPUTDIR="./input"
7
8 pubkey="$PUBDIR/mageia-board-pubkey.gpg"
9 seckey="$PRIVDIR/mageia-board-seckey"
10 seckey_e="$PRIVDIR/mageia-board-seckey.gpg"
11 passphrase="$PRIVDIR/passphrase"
12
13 echo 'Today is :'
14 date
15 echo '(check if the date is correct and press enter)'
16 read z
17
18 chmod 700 "$GPGHOMEDIR"
19
20 echo "Generate key :"
21 gpg --homedir "$GPGHOMEDIR" --batch --gen-key "$INPUTDIR/board.batch"
22
23 echo "Public key :"
24 gpg --homedir "$GPGHOMEDIR" --list-keys
25 gpg --homedir "$GPGHOMEDIR" --list-keys --fingerprint > "$PUBDIR/mageia-board-fingerprint.txt"
26 gpg --homedir homedir --export -a > "$pubkey"
27
28 echo "Secret key :"
29 gpg --homedir "$GPGHOMEDIR" --list-secret-keys
30 gpg --homedir homedir --export-secret-keys -a > "$seckey"
31
32 rm -Rf "$GPGHOMEDIR"
33
34 echo "Generate passphrase"
35 ./random-passphrase > "$passphrase"
36 gpg -c --passphrase-file "$passphrase" "$seckey"
37 rm -f "$seckey"
38
39 #TODO : split secret key using ssss-split
40

Properties

Name Value
svn:eol-style native
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.30