(self, secret=False)
return result
List the keys currently in the keyring.

        The GnuPG option '--show-photos', according to the GnuPG manual, "does
        not work with --with-colons", but since we can't rely on all versions
        of GnuPG to explicitly handle this correctly, we should probably
        include it in the args.

        >>> import shutil
        >>> shutil.rmtree("doctests")
        >>> gpg = GPG(homedir="doctests")
        >>> input = gpg.gen_key_input()
        >>> result = gpg.gen_key(input)
        >>> print1 = result.fingerprint
        >>> result = gpg.gen_key(input)
        >>> print2 = result.fingerprint
        >>> pubkeys = gpg.list_keys()
        >>> assert print1 in pubkeys.fingerprints
        >>> assert print2 in pubkeys.fingerprints
List the keys currently in the keyring.
List the keys currently in the keyring .
def list_keys(self, secret=False):
        """List the keys currently in the keyring.

        The GnuPG option '--show-photos', according to the GnuPG manual, "does
        not work with --with-colons", but since we can't rely on all versions
        of GnuPG to explicitly handle this correctly, we should probably
        include it in the args.

        >>> import shutil
        >>> shutil.rmtree("doctests")
        >>> gpg = GPG(homedir="doctests")
        >>> input = gpg.gen_key_input()
        >>> result = gpg.gen_key(input)
        >>> print1 = result.fingerprint
        >>> result = gpg.gen_key(input)
        >>> print2 = result.fingerprint
        >>> pubkeys = gpg.list_keys()
        >>> assert print1 in pubkeys.fingerprints
        >>> assert print2 in pubkeys.fingerprints
        """
        which = 'public-keys'
        if secret:
            which = 'secret-keys'

        args = []
        args.append("--fixed-list-mode")
        args.append("--fingerprint")
        args.append("--with-colons")
        args.append("--list-options no-show-photos")
        args.append("--list-%s" % (which))

        p = self._open_subprocess(args)

        # there might be some status thingumy here I should handle... (amk)
        # ...nope, unless you care about expired sigs or keys (stevegt)

        # Get the response information
        result = self._result_map['list'](self)
        self._collect_output(p, result, stdin=p.stdin)
        lines = result.data.decode(self._encoding,
                                   self._decode_errors).splitlines()
        self._parse_keys(result)
        return result
def list_keys ( self , secret = False ) : which = 'public-keys' if secret : which = 'secret-keys' args = [ ] args . append ( "--fixed-list-mode" ) args . append ( "--fingerprint" ) args . append ( "--with-colons" ) args . append ( "--list-options no-show-photos" ) args . append ( "--list-%s" % ( which ) ) p = self . _open_subprocess ( args ) # there might be some status thingumy here I should handle... (amk) # ...nope, unless you care about expired sigs or keys (stevegt) # Get the response information result = self . _result_map [ 'list' ] ( self ) self . _collect_output ( p , result , stdin = p . stdin ) lines = result . data . decode ( self . _encoding , self . _decode_errors ) . splitlines ( ) self . _parse_keys ( result ) return result