'This method creates a C{L{TrustRoot}} instance from the given
input, if possible.
@param trust_root: This is the trust root to parse into a
C{L{TrustRoot}} object.
@type trust_root: C{str}
@return: A C{L{TrustRoot}} instance if trust_root parses as a
trust root, C{None} otherwise.
@rtype: C{NoneType} or C{L{TrustRoot}}'

def parse(cls, trust_root):

    url_parts = _parseURL(trust_root)
    if (url_parts is None):
        return None
    (proto, host, port, path) = url_parts
    if (proto not in _protocols):
        return None
    if (path.find('#') != (-1)):
        return None
    if (host.find('*', 1) != (-1)):
        return None
    if host.startswith('*'):
        if ((len(host) > 1) and (host[1] != '.')):
            return None
        host = host[1:]
        wilcard = True
    else:
        wilcard = False
    tr = cls(trust_root, proto, wilcard, host, port, path)
    return tr
