aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2006-08-22 22:26:45 +0000
committerRob Austein <sra@hactrn.net>2006-08-22 22:26:45 +0000
commit638a2b15b32f796c76526dcd4c0cf4ea851e84fa (patch)
treeedae95dc47b04c897eb6886b6c751558a036cfc2 /scripts
parentd714d7d7ad6dea084b66d50cc3c81328ba4e209c (diff)
# on 2006/08/09 15:56:52, sra did:
Initial revision svn path=/scripts/gki.pl; revision=180
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gki.pl32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/gki.pl b/scripts/gki.pl
new file mode 100644
index 00000000..5e9f42e8
--- /dev/null
+++ b/scripts/gki.pl
@@ -0,0 +1,32 @@
+#!/usr/local/bin/perl
+eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
+ if $running_under_some_shell;
+ # this emulates #! processing on NIH machines.
+ # (remove #! line above if indigestible)
+
+eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
+ # process any FOO=bar switches
+
+$, = ' '; # set output field separator
+$\ = "\n"; # set output record separator
+
+while (<>) {
+ chomp; # strip record separator
+ if (/X509v3 Subject Key Identifier:/) {
+ $ski = $. + 1;
+ }
+ if (/X509v3 Authority Key Identifier:/) {
+ $aki = $. + 1;
+ }
+ if ($ski && $. == $ski) {
+ s/^[ ]*//;
+ $S = $_;
+ }
+ if ($aki && $. == $aki) {
+ s/^[ ]*keyid://;
+ $a = $_;
+ }
+}
+
+print $S, $a, $f;
+