Created
March 26, 2018 10:32
-
-
Save yottatsa/637a148cb679a6243b054934f2f6f632 to your computer and use it in GitHub Desktop.
Script to generate a list of participants for the Keybase-based keysigning party
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # based on https://fosdem.org/2018/keysigning/ | |
| TEAM="${1:-keysigning_fblon}" | |
| TMPDIR="$( mktemp -d -t ksp-XXXXXXXX )" | |
| cleanup() { | |
| rm -rf "$TMPDIR" | |
| } | |
| trap cleanup INT TERM | |
| echo "Importing keyring..." >&2 | |
| keybase team list-members $TEAM | awk '{print $3}' | ( | |
| while read u | |
| do | |
| curl "https://keybase.io/${u}/pgp_keys.asc" | |
| done | |
| ) | gpg2 --homedir "$TMPDIR" -q --import | |
| echo "Exporting text..." >&2 | |
| gpg2 --homedir "$TMPDIR" -q --fingerprint --list-key | | |
| tail -n +3 | # remove keyring name | |
| perl -pe ' | |
| BEGIN { $C=0; } | |
| s/\[expired:/uc($&)/e; | |
| if( m/^pub/ ) { | |
| print "--------------------------------------------------------------------------------\n\n" unless $C==0; | |
| printf "%03d [ ] Fingerprint OK [ ] ID OK\n", ++$C; | |
| } elsif( m/^uid/ ) { | |
| s/^uid\s*(\[[^\]]+\][ \t]+)?/uid /; # strip [trust] | |
| } elsif( m/^sub/ ) { | |
| $_=""; # Do not print | |
| } elsif( m/^$/ ) { | |
| $_=""; # Do not print | |
| } | |
| ' | |
| echo "Done" >&2 | |
| cleanup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment