storing gpg keys on a database

Robert J. Hansen rjh at
Mon Jan 19 13:57:54 CET 2009

Ramon Loureiro wrote:
> Thanks, but I'd like to build an application to quick search for keys
> and the input should be an email...

A couple of options:

1.  Create a regular SQL database with an email address as part of a
composite primary key, and a binary blob as an unindexed column

2.  Run your own local keyserver and run your queries against that.

#1 will probably be easier; #2 seems like it will probably be faster and
more reliable.  I did some looking into this a few years ago

That said, database engines tend to handle binary blobs very poorly.
You'll probably want to strip as many signatures as possible from the
keys before you import them, to keep their size down.

> If I have to export on the fly every key, it will be very slow.... isn't?

This is why you export the keys, and import them into the database, in

More information about the Gnupg-users mailing list