Page MenuHome GnuPG

Deleted secure key not quite deleted?
Closed, InvalidPublic

Description

I've found a couple of separate issues potentially, which seem to be
connected. Not sure how to log this, so here is one bug explaining it.
Basically I had created some test keys and then deleted them before
"productionising" the GPG solution I use. I had to import a private key from
a server where it was used before and the key has no User ID. Well, it does
show a single word (company name), but the following happens. After
importing it, I try to edit it by providing this single word user id. And it
goes into edit mode for one of those old keys instead. That old (deleted!)
secret key is not listed by "gpg -K". Yet it shows somehow? And the weird
thing is that this has a proper long User ID (which is not the same as this
new key I have just imported).
So I try to edit using the key id. But it says "gpg: key 'keyid...' not
found: No public key". However - if I try deleting it usign the same key id

  • it works!

sec xxxxx/keyid... 2013-01-03 [User ID not found]
Delete this key from the keyring? (y/N)

Again, I might have described a couple of different issues here, but not
knowing what's causing what, it's hard for me to separate these.

Details

Version
2.0.22

Event Timeline

Which version of GnUPG are you using?
Which operating system?
Can you please provide the commands you used?

I can't decide right now whether this might be a bug; You may also want to ask
on gnupg-users for help.

Hi Werner,

It's Linux 3.10.0-229.4.2.el7.x86_64 and GnuPG 2.0.22 libgcrypt 1.5.3.
If you mean the commands to delete the test secret key that is now somehow
still showing up when I try to delete the new public key, just imported,
that's:
gpg --delete-secret-keys 'user ID...'

Trying to edit the newly imported key:
gpg -u 'user ID for the key that is used to sign/trust keys' --edit-key
'user ID of the new key'
also tried
gpg -u 'user ID for the key that is used to sign/trust keys' --edit-key
keyID...

I hope this helps, thanks.
Raf

marcus added a subscriber: marcus.

Deleting a secret key does not delete the public key, which can still be edited. This is normal behaviour. You can use --delete-secret-and-public-key to delete both at the same time.