def check(self, hostname, key):
k = self.lookup(hostname)<EOL>if k is None:<EOL><INDENT>return False<EOL><DEDENT>host_key = k.get(key.get_name(), None)<EOL>if host_key is None:<EOL><INDENT>return False<EOL><DEDENT>return str(host_key) == str(key)<EOL>
Return True if the given key is associated with the given hostname
in this dictionary.

@param hostname: hostname (or IP) of the SSH server
@type hostname: str
@param key: the key to check
@type key: L{PKey}
@return: C{True} if the key is associated with the hostname; C{False}
    if not
@rtype: bool