Created
January 6, 2020 22:04
-
-
Save perfecto25/280710687aa5e11e08855e093f9bbdf1 to your computer and use it in GitHub Desktop.
gpg py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import gnupg | |
| from pprint import pprint | |
| gpg_home = '/home/user/.gnupg' | |
| def show_keys(): | |
| gpg = gnupg.GPG(gnupghome=gpg_home) | |
| public_keys = gpg.list_keys() | |
| private_keys = gpg.list_keys(True) | |
| all_keys = {} | |
| print(type(public_keys)) | |
| all_keys['public'] = public_keys | |
| all_keys['private'] = private_keys | |
| return all_keys | |
| if __name__ == "__main__": | |
| pprint(show_keys()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment