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

Annotation of /gpg/generate-key

Parent Directory Parent Directory | Revision Log Revision Log


Revision 390 - (hide annotations) (download) (as text)
Thu Feb 3 12:02:06 2011 UTC (13 years, 2 months ago) by boklm
Original Path: gpg/generate-key.sh
File MIME type: application/x-sh
File size: 974 byte(s)
encrypt secret key using passphrase
1 boklm 378 #!/bin/sh
2    
3     GPGHOMEDIR="./homedir"
4     PUBDIR="./public"
5     PRIVDIR="./private"
6 boklm 380 INPUTDIR="./input"
7 boklm 378
8     pubkey="$PUBDIR/mageia-board-pubkey.gpg"
9 boklm 390 seckey="$PRIVDIR/mageia-board-seckey"
10     seckey_e="$PRIVDIR/mageia-board-seckey.gpg"
11     passphrase="$PRIVDIR/passphrase"
12 boklm 378
13 boklm 379 echo 'Today is :'
14     date
15     echo '(check if the date is correct and press enter)'
16     read z
17    
18 boklm 378 chmod 700 "$GPGHOMEDIR"
19    
20     echo "Generate key :"
21 boklm 380 gpg --homedir "$GPGHOMEDIR" --batch --gen-key "$INPUTDIR/board.batch"
22 boklm 378
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 boklm 384 echo "Generate passphrase"
35 boklm 390 ./random-passphrase > "$passphrase"
36     gpg -c --passphrase-file "$passphrase" "$seckey"
37     rm -f "$seckey"
38 boklm 384
39 boklm 378 #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