storing gpg keys on a database

Werner Koch wk at
Mon Jan 19 14:34:53 CET 2009

On Mon, 19 Jan 2009 13:57, rjh at said:

> 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

Alternatively store the fingerprint and then use the fingerprint to
specify the key or to extract it.  If you want to have a format that
will work in the future you may prepend a "2:" to the fingerprint.  Example:

  $ gpg --list-keys --with-fingerprint --with-colons --fixed-list-mode
  uid:f::::1199120023::[...]::Werner Koch <wk at>:

With that data you would insert this into your DB.

"wk at" -> "2:80615870F5BAD690333686D0F2AD85AC1E42B367"

The reason for the "2:" is that the OpenPGP format will eventually be
changed to compute the fingerprint using a different algorithm.  The
"2:" indicates the curent algorithm.  If you need to save space you
would of course not use the hex encoding of the fingerprint.



Die Gedanken sind frei.  Auschnahme regelt ein Bundeschgesetz.

More information about the Gnupg-users mailing list