Ok, here's an example with enough tools to handle most of the common
cases. For now you can get these tools from 
svn://svn.kitenet.net/joey/trunk/src/packages/unreleased/jetring/

[EMAIL PROTECTED]:~>ls jetring
changeset-accept*  changeset-review*  keyring-gen*
changeset-apply*   keyring-explode*
[EMAIL PROTECTED]:~>export PATH=$PATH:~/jetring
[EMAIL PROTECTED]:~>cd ~/tmp/debian-keyring-2005.05.28/keyrings
[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>keyring-explode 
emeritus-keyring.pgp emeritus-keyring
emeritus-keyring/add-17D57681
emeritus-keyring/add-6F7267F5
emeritus-keyring/add-B269698D
emeritus-keyring/add-647B8331
emeritus-keyring/add-64433805
....
[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>head 
emeritus-keyring/add-001B3BA1 
Comment: extracted from emeritus-keyring.pgp by keyring-explode
Action: import
Data:
  -----BEGIN PGP PUBLIC KEY BLOCK-----
  Version: GnuPG v1.4.6 (GNU/Linux)
  
  mQBtAzI+bhkAAAEDAOn0rvREGipkloa17NRJcSHweJJuhGo5EIPM3XDXbfXF4j18
  TBWgGisic/QqtGvOwVVgQitS1evqOHgcRrNOPc/0tOuruR8qtEX33ypwjiZlK30M
  evm8E9wUEkkpABs7oQAFEbQnQmpvcm4gQnJlbmFuZGVyIDxiam9ybkBicmVuYW5k
  ZXIucHAuc2U+iQB1AwUQM9T0FhQSSSkAGzuhAQEJTQL9FF2qV4aBYgWKdKu4MdG6
[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>head 
emeritus-keyring/index
9c55ce36c00df3d6edec08106db06be1  add-17D57681
9316b0b1f37b97d99336df760deac6ef  add-6F7267F5
e2480c78d9b39694775f6bec21023e9b  add-B269698D
f868db4c2eff8751e8fdc53d6b105c0b  add-647B8331
c68795f636ecf52fa6cdff7e71b18915  add-64433805
0836a942d9aa1ca54c9976969a26380c  add-DEA67011
5f1af519711e704104550ce984d6033c  add-B1CE8961
7c646b8bb334684d164147221c407424  add-5BB0DA6D
4627e1f9cc0c91cfbb5e2c5a3adb45b9  add-FA00F50D
6e64f607284940c6842932f1bf55b4bc  add-ABB90E15

keyring-explode is a one-time operation, so a bit slow, but now the
changesets are ready for use. First, let's rebuild the keyring from
them, and compare to make sure no data is being lost (or added!):

[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>keyring-gen 
newring.gpg emeritus-keyring
Applying emeritus-keyring/add-17D57681 ...
gpg --import 
gpg: key 17D57681: public key "Joel Klecker <[EMAIL PROTECTED]>" imported
gpg: key 17D57681: "Joel Klecker <[EMAIL PROTECTED]>" not changed
gpg: Total number processed: 2
gpg:               imported: 1  (RSA: 1)
gpg:              unchanged: 1
gpg operation complete

...

Applying emeritus-keyring/add-F9033421 ...
gpg --import 
gpg: key F9033421: public key "Herbert Xu <[EMAIL PROTECTED]>" imported
gpg: key F9033421: "Herbert Xu <[EMAIL PROTECTED]>" 2 new signatures
gpg: Total number processed: 2
gpg:               imported: 1  (RSA: 1)
gpg:         new signatures: 2
gpg operation complete

All changesets applied ok.
[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>ls -l newring.gpg 
emeritus-keyring.gpg
-rw-r--r-- 1 joey joey 167537 Feb 24 02:03 emeritus-keyring.gpg
-rw-r--r-- 1 joey joey  94855 Feb 24 02:06 newring.gpg
[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>gpg 
--no-default-keyring --keyring ./emeritus-keyring.gpg --list-keys > a
[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>gpg 
--no-default-keyring --keyring ./newring.pgp --list-keys > b
[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>diff -u a b
--- a   2007-02-24 02:15:29.000000000 -0500
+++ b   2007-02-24 02:15:35.000000000 -0500
@@ -1,5 +1,5 @@
-./emeritus-keyring.pgp
-----------------------
+./newring.gpg
+-------------
 pub   1024R/17D57681 1996-06-26
 uid                  Joel Klecker <[EMAIL PROTECTED]>
 uid                  Joel Klecker <[EMAIL PROTECTED]>
@@ -161,10 +161,10 @@
 pub   1024R/22714B25 1998-08-30
 uid                  Stephen Crowley <[EMAIL PROTECTED]>
 uid                  Stephen Crowley <[EMAIL PROTECTED]>
-uid                  Stephen Crowley <[EMAIL PROTECTED]>
 uid                  Stephen Crowley <[EMAIL PROTECTED]>
 uid                  Stephen Crowley <[EMAIL PROTECTED]>
 uid                  Stephen Crowley <[EMAIL PROTECTED]>
+uid                  Stephen Crowley <[EMAIL PROTECTED]>
 
 pub    768R/21978C61 1996-08-13
 uid                  Hubert Weikert <[EMAIL PROTECTED]>
@@ -347,7 +347,6 @@
 pub   1024R/8F23DC91 1994-12-20
 uid                  Joe Reinhardt <[EMAIL PROTECTED]>
 uid                  Joe Reinhardt <[EMAIL PROTECTED]>
-uid                  Joe Reinhardt <[EMAIL PROTECTED]>
 uid                  [EMAIL PROTECTED]
 uid                  [EMAIL PROTECTED]
 uid                  Joseph M. Reinhardt <[EMAIL PROTECTED]>

Ok, no significant changes, only id rearrangement and dup removal.

I've done the same for debian-keyring.gpg, with similar results, just took
a bit longer.

On to making changes..

[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>cat > joeyh.retired
Changed-By: Joey Hess <[EMAIL PROTECTED]>
Comment: had to happen some day
Date: Sat, 24 Feb 2007 02:18:51 -0500
Action: delete-key 788A3F4C
Data: y
[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>changeset-review 
newring.gpg joeyh.retired 
>> y
gpg --delete-key 788A3F4C
gpg (GnuPG) 1.4.6; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.


pub  1024D/788A3F4C 1999-09-08 Joey Hess <[EMAIL PROTECTED]>

gpg operation complete


Looks good, so accept this changeset.

[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>changeset-accept 
debian-keyring joeyh.retired
[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>

Now, after making some changes, it's time to produce a keyring.
Since I already have one that was built by keyring-gen, I can update it
in incremental mode, which is much faster than a full rebuild:

[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>keyring-gen -i 
newring.gpg debian-keyring
Skipping forward past changeset add-1E880A84 ...
Applying debian-keyring/joeyh.retired ...
gpg --delete-key 788A3F4C
gpg (GnuPG) 1.4.6; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

>> y

pub  1024D/788A3F4C 1999-09-08 Joey Hess <[EMAIL PROTECTED]>

gpg operation complete

All changesets applied ok.


[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>gpg 
--no-auto-check-trustdb --no-default-keyring --keyring ./newring.gpg 
--list-keys |grep 788A3F4C
gpg: please do a --check-trustdb
[EMAIL PROTECTED]:~/tmp/debian-keyring-2005.05.28/keyrings>


No more me. Hurrah!

It might be ok to use keyring-gen in interactive mode like this for
day-to-day maintenace, and only do a full rebuild for uploads of the
debian-keyring package. The debian-keyring source package could be
modified to contain the changeset directories, and build the keyrings
from them, and then we could even send in diffs against it to submit
changes.

I've left out one thing that might be worth doing, namely gpg signing of
the changesets and the index file, and verification of the signatures
before applying changesets. With that in place, it would be possible to
check the changesets into a revision control system, and let others
commit changesets, which can then be reviewed and signed.

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature

Reply via email to