@@ -641,67 +641,6 @@ is a list of the key fingerprints associated with the listed keys.
641641 straight to the key info, whether the fingerprint you have is for a key or a
642642 subkey.
643643
644- .. versionadded :: 0.5.5
645- The returned value from :meth: `~gnupg.GPG.list_keys ` now has a new
646- attribute, ``uid_map ``, which is a dictionary mapping uids to dicts with
647- detailed information about the corresponding uid. The keys of the information
648- provided are listed in the table above. Refer to the `GnuPG documentation
649- <https://github.com/gpg/gnupg/blob/master/doc/DETAILS> `_ for more information.
650-
651- You could use this information as in the following example:
652-
653- .. code-block :: pycon
654-
655- >>> from pprint import pprint
656- >>> keys = gpg.list_keys()
657- >>> pprint(keys.uids)
658- ['Andrew Able (A test user) <andrew.able@alpha.com>',
659- 'Barb Bruin <barb.bruin@beta.com>',
660- 'Babs Broon <babs.broon@beta.com>',
661- 'Barbara Brown (A test user) <barbara.brown@beta.com>',
662- 'Charlie Clark (A test user) <charlie.clark@gamma.com>',
663- 'Donna Davis (A test user) <donna.davis@delta.com>']
664- >>> pprint(keys.uid_map('Barbara Brown (A test user) <barbara.brown@beta.com>')
665- {'algo': '',
666- 'date': '1739485458',
667- 'dummy': '8B989767967370B894C53279A3BDF655F00CD4DE',
668- 'expires': '',
669- 'keyid': '',
670- 'length': '',
671- 'ownertrust': '',
672- 'sig': '',
673- 'trust': 'u',
674- 'type': 'uid',
675- 'uid': 'Barbara Brown (A test user) <barbara.brown@beta.com>'}
676- >>> pprint(keys.uid_map['Barb Bruin <barb.bruin@beta.com>'])
677- {'algo': '',
678- 'date': '1739485886',
679- 'dummy': '951261047308BCA0B45FD738AD8630B336B88ECF',
680- 'expires': '',
681- 'keyid': '',
682- 'length': '',
683- 'ownertrust': '',
684- 'sig': '',
685- 'trust': 'u',
686- 'type': 'uid',
687- 'uid': 'Barb Bruin <barb.bruin@beta.com>'}
688- >>> pprint(keys.uid_map['Babs Broon <babs.broon@beta.com>'])
689- {'algo': '',
690- 'date': '',
691- 'dummy': '2BDB74660AC54DF33DE523429386E2D460904E74',
692- 'expires': '',
693- 'keyid': '',
694- 'length': '',
695- 'ownertrust': '',
696- 'sig': '',
697- 'trust': 'r',
698- 'type': 'uid',
699- 'uid': 'Babs Broon <babs.broon@beta.com>'}
700- >>>
701-
702- The first two of these dictionaries show normal uids (trust is 'u', for ultimate), whereas the third
703- shows a revoked uid (trust is 'r', for revoked).
704-
705644.. versionadded :: 0.3.8
706645 You can also list a subset of keys by specifying a ``keys= `` keyword
707646 argument to :meth: `~gnupg.GPG.list_keys ` whose value is either a single
@@ -728,15 +667,6 @@ is a list of the key fingerprints associated with the listed keys.
728667 a separate stream. The callable should not raise any exceptions (unless it wants
729668 the current operation to fail).
730669
731- .. versionadded :: 0.5.4
732- Instances of the result classes from operations now have an ``on_data_failure ``
733- attribute, which defaults to ``None ``. If an ``on_data `` callable raises an exception,
734- the ``on_data_failure `` attribute of the returned object from a high-level operation
735- is set to the first exception that was raised. The ``on_data `` callable will continue
736- to be called with future chunks. If you use ``on_data `` with code that can raise any
737- exceptions, be sure to check the ``on_data_failure `` attribute of a returned object
738- before using any other aspects of the result.
739-
740670.. versionadded :: 0.4.2
741671 Information on keys returned by :meth: `~gnupg.GPG.list_keys ` or
742672 :meth: `~gnupg.GPG.scan_keys ` now incudes a ``subkey_info `` dictionary, which
@@ -777,6 +707,77 @@ is a list of the key fingerprints associated with the listed keys.
777707 values with the ``keygrip `` being the fourth. Note that you'll need GnuPG >=
778708 2.1 for this to work.
779709
710+ .. versionadded :: 0.5.4
711+ Instances of the result classes from operations now have an ``on_data_failure ``
712+ attribute, which defaults to ``None ``. If an ``on_data `` callable raises an exception,
713+ the ``on_data_failure `` attribute of the returned object from a high-level operation
714+ is set to the first exception that was raised. The ``on_data `` callable will continue
715+ to be called with future chunks. If you use ``on_data `` with code that can raise any
716+ exceptions, be sure to check the ``on_data_failure `` attribute of a returned object
717+ before using any other aspects of the result.
718+
719+ .. versionadded :: 0.5.5
720+ The returned value from :meth: `~gnupg.GPG.list_keys ` now has a new
721+ attribute, ``uid_map ``, which is a dictionary mapping uids to dicts with
722+ detailed information about the corresponding uid. The keys of the information
723+ provided are listed in the table above. Refer to the `GnuPG documentation
724+ <https://github.com/gpg/gnupg/blob/master/doc/DETAILS> `_ for more information.
725+
726+ You could use this information as in the following example:
727+
728+ .. code-block :: pycon
729+
730+ >>> from pprint import pprint
731+ >>> keys = gpg.list_keys()
732+ >>> pprint(keys.uids)
733+ ['Andrew Able (A test user) <andrew.able@alpha.com>',
734+ 'Barb Bruin <barb.bruin@beta.com>',
735+ 'Babs Broon <babs.broon@beta.com>',
736+ 'Barbara Brown (A test user) <barbara.brown@beta.com>',
737+ 'Charlie Clark (A test user) <charlie.clark@gamma.com>',
738+ 'Donna Davis (A test user) <donna.davis@delta.com>']
739+ >>> pprint(keys.uid_map('Barbara Brown (A test user) <barbara.brown@beta.com>')
740+ {'algo': '',
741+ 'date': '1739485458',
742+ 'dummy': '8B989767967370B894C53279A3BDF655F00CD4DE',
743+ 'expires': '',
744+ 'keyid': '',
745+ 'length': '',
746+ 'ownertrust': '',
747+ 'sig': '',
748+ 'trust': 'u',
749+ 'type': 'uid',
750+ 'uid': 'Barbara Brown (A test user) <barbara.brown@beta.com>'}
751+ >>> pprint(keys.uid_map['Barb Bruin <barb.bruin@beta.com>'])
752+ {'algo': '',
753+ 'date': '1739485886',
754+ 'dummy': '951261047308BCA0B45FD738AD8630B336B88ECF',
755+ 'expires': '',
756+ 'keyid': '',
757+ 'length': '',
758+ 'ownertrust': '',
759+ 'sig': '',
760+ 'trust': 'u',
761+ 'type': 'uid',
762+ 'uid': 'Barb Bruin <barb.bruin@beta.com>'}
763+ >>> pprint(keys.uid_map['Babs Broon <babs.broon@beta.com>'])
764+ {'algo': '',
765+ 'date': '',
766+ 'dummy': '2BDB74660AC54DF33DE523429386E2D460904E74',
767+ 'expires': '',
768+ 'keyid': '',
769+ 'length': '',
770+ 'ownertrust': '',
771+ 'sig': '',
772+ 'trust': 'r',
773+ 'type': 'uid',
774+ 'uid': 'Babs Broon <babs.broon@beta.com>'}
775+ >>>
776+
777+ The first two of these dictionaries show normal uids (trust is 'u', for ultimate), whereas the third
778+ shows a revoked uid (trust is 'r', for revoked).
779+
780+
780781.. _RFC-4880 : https://tools.ietf.org/html/rfc4880#section-5.2.1
781782
782783
0 commit comments