fix some things in ma certifier functions:
[monkeysphere.git] / src / share / ma / list_certifiers
1 # -*-shell-script-*-
2 # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant)
3
4 # Monkeysphere authentication list-certifiers subcommand
5 #
6 # The monkeysphere scripts are written by:
7 # Jameson Rollins <jrollins@fifthhorseman.net>
8 # Jamie McClelland <jm@mayfirst.org>
9 # Daniel Kahn Gillmor <dkg@fifthhorseman.net>
10 #
11 # They are Copyright 2008-2009, and are all released under the GPL,
12 # version 3 or later.
13
14 # list the host certifiers
15
16 list_certifiers() {
17
18 local keys
19 local key
20
21 # find trusted keys in sphere keychain
22 log debug "finding trusted keys..."
23
24 # NOTE: looking for only 'f' keys here (used to be '(u|f)'), since the
25 # only key that should be 'u' is the core key, which is not
26 # technically a certifier in the sense we're worried about.  Is this
27 # not correct?  Should we be sorting out the certifier keys in a
28 # different way?
29 keys=$(gpg_sphere "--list-keys --with-colons --fingerprint" | \
30     grep ^pub: | cut -d: -f2,5 | egrep '^f:' | cut -d: -f2)
31
32 # output keys
33 for key in $keys ; do
34     gpg_sphere "--list-key --fingerprint 0x${key}!"
35 done
36
37 }