def save_host_keys(self, filename):
f = open(filename, '<STR_LIT:w>')<EOL>f.write('<STR_LIT>')<EOL>for hostname, keys in self._host_keys.items():<EOL><INDENT>for keytype, key in keys.items():<EOL><INDENT>f.write('<STR_LIT>' % (hostname, keytype, key.get_base64()))<EOL><DEDENT><DEDENT>f.close()<EOL>
Save the host keys back to a file.  Only the host keys loaded with
L{load_host_keys} (plus any added directly) will be saved -- not any
host keys loaded with L{load_system_host_keys}.

@param filename: the filename to save to
@type filename: str

@raise IOError: if the file could not be written