#!/usr/bin/env ruby
require 'gpgme'

pat = ARGV.shift || ''
out = ''
ctx = GPGME::GpgmeCtx.new
ctx.each_keys(pat) {|key| out << key.xml}
puts <<EOF
<?xml version='1.0'>
<GnupgKeyblocks>
#{out}</GnupgKeyblocks>
EOF
