def validate_url(url)
parts = TrustRoot._parse_url(url)
return false if parts.nil?
proto, host, port, path = parts
return false unless proto == @proto
return false unless port == @port
return false unless host.index('*').nil?
if !@wildcard
if host != @host
return false
end
elsif ((@host != '') and
(!host.ends_with?('.' + @host)) and
(host != @host))
return false
end
if path != @path
path_len = @path.length
trust_prefix = @path[0...path_len]
url_prefix = path[0...path_len]
if trust_prefix != url_prefix
return false
end
if !@path.index('?').nil?
allowed = '&'
else
allowed = '?/'
end
return (!allowed.index(@path[-1]).nil? or
!allowed.index(path[path_len]).nil?)
end
return true
end