2
2
# Prepare a printable list of keysigning participants.
3
3
# Useful for the party organiser.
5
# $Id: gpgparticipants 499 2013-10-15 19:23:04Z weasel $
5
# $Id: caff 588 2014-03-24 01:15:29 +0100 guilhem-guest $
7
7
# License: GPLv2 or later
8
8
# Copyright Philippe Teuwen <phil a teuwen o org> 2008
12
Usage: $0 input output datestring organizer title
13
Or: $0 - output datestring organizer title
16
echo 9AD7E3DB 54C12701 |\\
17
$0 - ksp-file.txt "20080222 1100" "My Name <my.name@my.mail>" "my party 08"
12
Usage: $0 [-a HASHES|--algorithm HASHES] input output datestring organizer title
14
Use a single hyphen-minus (-) in place of input to read from STDIN
15
(resp. of output to write to STDOUT).
17
echo 9AD7E3DB 54C12701 |\\
18
$0 - ksp-file.txt "20080222 1100" "My Name <my.name@my.mail>" "my party 08"
24
# Handle options and arguments
25
##############################
27
# Use getopt to validate and normalize options and arguments,
28
# then reinject them as main arguments
29
OPTS=$(getopt -o a:h -l algorithm:,help -n $0 -- "$@") || usage 1
33
algos="SHA256,RIPEMD160"
36
while [ "$1" != -- ]; do
38
-a|--algorithm) algos="$2"; shift 2;;
39
-h|--help) usage 0; shift;;
44
# Get rid of the '--' left before the arguments
47
# Five arguments should remain
48
[ $# -eq 5 ] || usage 1
49
algos=$(echo "$algos" | tr '[:lower:]' '[:upper:]')
52
algos=$(echo "$algos" | tr ',' ' ')
53
for algo in $algos; do
54
# Ensure this is a valid algo
55
gpg --print-md "$algo" /dev/null >/dev/null || exit $?
23
59
[ "$input" = "-" ] && input="";
42
78
Here's what you have to do with this file:
43
(1) Print this file to paper.
44
(2) Compute this file's SHA256 checksum.
45
gpg --print-md sha256 $output (or use sha256sum)
80
(1) Print this UTF-8 encoded file to paper.
82
(2) Compute this file's $(echo "$halgos" | sed -re 's/,([^,]+)$/ and \1/; s/,/& /g') checksum$([ "${algos#* }" = "$algos" ] || echo s).
85
for algo in $algos; do
86
printf " gpg --print-md %s %s\n" "$algo" "$output"
46
90
(3) Fill in the hash values on the printout.
47
92
(4) Bring the printout, a pen, and proof of identity to the key signing party
51
SHA256 Checksum: ____ ____ ____ ____ ____ ____ ____ ____ [ ]
53
____ ____ ____ ____ ____ ____ ____ ____
96
for algo in $algos; do
100
MD5 Checksum: __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ [ ]
104
SHA1 Checksum: ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ [ ]
107
RIPEMD160) cat <<- EOF
108
RIPEMD160 Checksum: ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ [ ]
112
SHA256 Checksum: ________ ________ ________ ________
114
________ ________ ________ ________ [ ]
118
SHA384 Checksum: ________ ________ ________ ________
120
________ ________ ________ ________
122
________ ________ ________ ________ [ ]
126
SHA512 Checksum: ________ ________ ________ ________
128
________ ________ ________ ________
130
________ ________ ________ ________
132
________ ________ ________ ________ [ ]
136
SHA224 Checksum: ________ ________ ________ ________
138
________ ________ ________ [ ]
59
for i in $(cat $input); do
147
options='--list-options no-show-photos,no-show-uid-validity,no-show-keyring'
61
151
printf "\n%03d [ ] Fingerprint OK [ ] ID OK\n" $k;
62
gpg --fingerprint $i | grep -v "^sub" | \
63
grep -v '^uid.*jpeg image of size';
152
LC_CTYPE=C.UTF-8 gpg $options --fingerprint --list-keys -- $i \
153
| grep -ve "^sub" -e '^uid *\[jpeg image of size ';
64
154
echo "_______________________________________________________________________________"