Skip to content

Commit

Permalink
add gpg2 -k parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Yann Büchau committed Jun 15, 2017
1 parent 5d87f08 commit 4aa4bfc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# instantiated files
uca-apply
uca-manip
parse-gpg2-k
9 changes: 9 additions & 0 deletions bin/parse-gpg2-k.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!@perl_bin@
use warnings;
use strict;
my ($pubkey,$tmp,$name,$email);
while(<>){ # read from STDIN
$pubkey = $tmp if(($tmp) = m#^pub\s*[^/]*/([a-z0-9]+)\s*#ig);
($name,$email) = m#^uid\s*(?:\[[^\]]*\])?\s*(.*)\s*<([^>]*)>#ig;
print join("\n",$pubkey,$name,$email),"\n" if($pubkey and $name and $email);
};

0 comments on commit 4aa4bfc

Please sign in to comment.