# File lib/gpgme.rb, line 456
def GPGME.export(*args_options)
  raise ArgumentError, 'wrong number of arguments' if args_options.length > 2
  args, options = split_args(args_options)
  pattern, key = args[0]
  key_data = output_data(key)
  check_version(options)
  GPGME::Ctx.new(options) do |ctx|
    ctx.export_keys(pattern, key_data)

    unless key
      key_data.seek(0, IO::SEEK_SET)
      key_data.read
    end
  end
end