keys_for (Net::SSH::KnownHosts)

         # File lib/net/ssh/known_hosts.rb, line 87
     87:     def keys_for(host)
     88:       keys = []
     89:       return keys unless File.readable?(source)
     90:
     91:       entries = host.split(/,/)
     92:
     93:       File.open(source) do |file|
     94:         scanner = StringScanner.new("")
     95:         file.each_line do |line|
     96:           scanner.string = line
     97:
     98:           scanner.skip(/\s*/)
     99:           next if scanner.match?(/$|#/)
    100:
    101:           hostlist = scanner.scan(/\S+/).split(/,/)
    102:           next unless entries.all? { |entry| hostlist.include?(entry) }
    103:
    104:           scanner.skip(/\s*/)
    105:           type = scanner.scan(/\S+/)
    106:
    107:           next unless %w(ssh-rsa ssh-dss).include?(type)
    108:
    109:           scanner.skip(/\s*/)
    110:           blob = scanner.rest.unpack("m*").first
    111:           keys << Net::SSH::Buffer.new(blob).read_key
    112:         end
    113:       end
    114:
    115:       keys
    116:     end