deleting secret key without public key

Martin Blais blais@iro.umontreal.ca
Sat Dec 15 03:14:01 2001


Hi again.

Ok, so now I think I've really messed up...

Computer was stolen, and there I am, trying all sorts of different 
experiments with GPG.  I copied my "options" file by accident, which specifes 
the alternate location for the very last copy of my secret ring, without a 
backup copy (I should ask someone to kick myself in the butt really hard for 
doing that).  Of course I forgot to change the options file... so...

While diddling, I added another secret key to my secret ring.  I deleted the 
experimental rings, so now I end up with the secret key I don't want in my 
ring, but no public key.

So I read the FAQ, where this is explicitly addressed, but I still cannot 
remove it.  The FAQ says:

-----
4.6) I can't delete the secret key because my public key disappeared? 

 To select a key a search is always done on the public keyring, therefore it 
is not possible to select an secret key without having the public key. 
Normally it shoud never happen that the public key got lost but the secret 
key is still available. The reality is different, so we GnuPG implements a 
special way to do deal with it: Simply use the long keyid which you can 
figure out by using the --with-colons options (it is the fifth field in the 
lines beginning with "sec"). 
------

I've tried the following, to no avail, with the long id mentioned above:

lima:[blais_1]~/tmp$ gpg --delete-secret-key F6764E6A1DA3AD17
gpg (GnuPG) 1.0.6; Copyright (C) 2001 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.

gpg: Warning: using insecure memory!
gpg: key 1DA3AD17: secret key without public key - skipped
gpg: F6764E6A1DA3AD17: user not found
gpg: F6764E6A1DA3AD17: delete key failed: secret key not available

and then


lima:[blais_1]~/tmp$ gpg --delete-key F6764E6A1DA3AD17
gpg (GnuPG) 1.0.6; Copyright (C) 2001 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.

gpg: Warning: using insecure memory!
gpg: F6764E6A1DA3AD17: user not found
gpg: F6764E6A1DA3AD17: delete key failed: public key not found



I also tried reimporting my secret ring with the --allow-secret-key-import 
option, ebut I cannot seem to select which keys gt imported, so I still end 
up with both secret keys (one of which I don't want).

Any idea how I could get out of this mess?
Thanks.
Please Cc to blais@iro.umontreal.ca.

--
M.