1 eval '(exit $?0)' && eval 'exec perl -wST "$0" ${1+"$@"}'
2 & eval 'exec perl -wST "$0" $argv:q'
7 my $certdir = $ARGV[0];
8 my $certfile = $ARGV[1];
13 if (! -f "$certdir/certinfo.txt") {
14 system("for i in $certdir/*.crt; do echo -n \$i:; certtool --inder -i < \$i|grep 'Subject Key Id' -A 1|tail -1; done > $certdir/certinfo.txt");
18 print "Parsing $certdir/$certfile...\n";
20 $info = `certtool --inder -i < $certdir/$certfile`;
24 if ($info =~ m,Authority Key Identifier.*:\n[\t]*([a-z0-9]+),m) {
27 die "Could not find AKI";
30 print "Finding AKI $aki...\n";
32 $list = `cat $certdir/certinfo.txt | grep $aki`;
33 if ($list =~m,.*/(.*):.*,) {
36 die "Could not find issuer";