'Validates a URL against this trust root.
@param url: The URL to check
@type url: C{str}
@return: Whether the given URL is within this trust root.
@rtype: C{bool}'

def validateURL(self, url):

    url_parts = _parseURL(url)
    if (url_parts is None):
        return False
    (proto, host, port, path) = url_parts
    if (proto != self.proto):
        return False
    if (port != self.port):
        return False
    if ('*' in host):
        return False
    if (not self.wildcard):
        if (host != self.host):
            return False
    elif ((not host.endswith(self.host)) and (('.' + host) != self.host)):
        return False
    if (path != self.path):
        path_len = len(self.path)
        trust_prefix = self.path[:path_len]
        url_prefix = path[:path_len]
        if (trust_prefix != url_prefix):
            return False
        if ('?' in self.path):
            allowed = '&'
        else:
            allowed = '?/'
        return ((self.path[(-1)] in allowed) or (path[path_len] in allowed))
    return True
