def each_key(pattern = nil, secret_only = false, &block)
      keylist_start(pattern, secret_only)
      begin
        loop { yield keylist_next }
      rescue EOFError
        # The last key in the list has already been returned.
      ensure
        keylist_end
      end
    end
def each_key(pattern = nil, secret_only = false, &block)
      keylist_start(pattern, secret_only)
      begin
        loop { yield keylist_next }
      rescue EOFError
        # The last key in the list has already been returned.
      ensure
        keylist_end
      end
    end
Convenient method to iterate over keys.

 If +pattern+ is +nil+, all available keys are returned. If +secret_only+
 is +true+, only secret keys are returned.

 See {GPGME::Key.find} for an example of how to use, or for an easier way
 to use.