Skip to content

Instantly share code, notes, and snippets.

@antoninkriz
Created October 14, 2021 13:18
Show Gist options
  • Save antoninkriz/4471105ee23543b118f15e2c495f7ad1 to your computer and use it in GitHub Desktop.
Save antoninkriz/4471105ee23543b118f15e2c495f7ad1 to your computer and use it in GitHub Desktop.
Prints all saved secrets in Gnome Keyring using Python 2
#!/usr/bin/env python
import gnomekeyring as gk
for keyring in gk.list_keyring_names_sync():
print('=== KEYRING ' + keyring + ' ===')
for keyItem in gk.list_item_ids_sync(keyring):
try:
key = gk.item_get_info_sync(keyring, keyItem)
except:
print 'Error fetching key ' + keyItem + ' from keyring ' + keyring
continue
print key.get_display_name() + ' : ' + key.get_secret()
print
print
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment