Page MenuHome GnuPG

gpg2 --delete-key output confusing with stubbed secret keys
Open, NormalPublic

Description

Consider the following key:

  $ gpg2 --list-secret-key 19DF4F53
  sec#  3744R/19DF4F53 2015-04-04 [expires: 2025-04-01]
  uid                  Test <test@test.com>
  ssb>  2048R/0352BEC3 2015-04-04 [expires: 2017-04-03]
  ssb>  2048R/FF73E89E 2015-04-04 [expires: 2017-04-03]
  ssb>  2048R/A478AA83 2015-04-04 [expires: 2017-04-03]

Note: the secret keys are not present in the keyring (as per the 'sec#' and
'ssb>'). Trying to delete this key results in the confusing error message:

  $ gpg2 --delete-key 19DF4F53
  gpg (GnuPG) 2.0.26; Copyright (C) 2013 Free Software Foundation, Inc.
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
  
  gpg: there is a secret key for public key "19DF4F53"!
  gpg: use option "--delete-secret-keys" to delete it first.

Yes there is a secret key for the specified key, but removing the key
from *this* keyring will not delete the secret key.