Skip to content

revoked uid(s) are listed in list_keys() -> uids: [] #250

@pettai

Description

@pettai

Describe the bug
revoked uid(s) are listed in list_keys() -> uids: []

To Reproduce
Steps to reproduce the behavior:

  1. create or use a existing key
  2. gpg --edit-key <keyid>
  3. add a uid
  4. revoke the added uid
  5. list the keys using gpg -k (doesn't list revoked uid(s))
pub   rsa4096 2025-01-17 [SC]
      F35AA3797588C94A8ZXXXXXXXXXXXXXXX
uid           [ unknown] My Name <mail@some.mail>
uid           [ unknown] My Name <othermail@somewhere.else>
[...]
  1. list keys using list_keys() (shows the revoked uid in uids: [])

[...], 'uids': ['My Name <mail@some.mail>', 'My Name <othermail@somewhere.else>', 'My Name <this_is_revoked@email.address>', [...] ]

(gpg --edit-key <keyid> shows that it's revoked)

[...]
pub  rsa4096/XXXXXXXXXXXXXXX
     created: 2025-01-17  expires: never       usage: SC
     trust: unknown       validity: unknown
[...]
[ unknown] (1). My Name <mail@some.mail>
[ unknown] (2)  My Name <othermail@somewhere.else>
[ revoked] (3)  My Name <this_is_revoked@email.address>
[...]

Expected behavior
Hide the revoked uid(s) in uids: [] and perhaps add an option to list_keys(uids=False) (default) == don't list revoked uid(s), and uids=True lists all + revoked uids)

Environment

  • Ubuntu 22.04
  • python-gnupg 0.5.3 aswell as 0.5.2-1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions