2 # Written by Jonathan McDowell <noodles@earth.li>
3 # Dedicated to linguists called Simon everywhere.
5 # An attempt at parsing the output of gpg -v --with-colons --list-keys
6 # Not completed yet. Will replace gpgpre and allow info on keysize/type.
10 my ($curline, $rsa, $dsa, $elg, $elgeo);
12 $rsa=$dsa=$elg=$elgeo=0;
14 while ($curline = <>) {
17 if ($curline =~ /^pub:.*:\d*:(\d*):([0-9a-fA-F]*):.*:.*:.*:.*:(.*):/) {
29 } elsif ($curline =~ /^sig:.*:\d*:(\d*):([0-9a-fA-F]*):.*:.*:.*:.*:.*/) {
31 } elsif ($curline =~ /^uid:/) {
33 } elsif ($curline =~ /^sub:/) {
35 } elsif ($curline =~ /^rev:/) {
42 print "RSA keys: $rsa, DSA keys: $dsa, ELG encrypt-only: $elgeo, ELG: $elg\n";