code: def list_keys(hint=None, private=False):
      
      ctx = gpg.core.Context()
      return ctx.keylist(hint, private)
docs: Returns a generator of all keys containing the fingerprint, or all keys if
      hint is None.
  
      The generator may raise exceptions of :class:gpg.errors.GPGMEError, and it
      is the caller's responsibility to handle them.
  
      :param hint: Part of a fingerprint to usee to search
      :type hint: str or None
      :param private: Whether to return public keys or secret keys
      :type private: bool
      :returns: A generator that yields keys.
      :rtype: Generator[gpg.gpgme.gpgme_key_t, None, None]