def is_publicly_trusted(domain):
    """
    A domain has a "Publicly Trusted" certificate if its canonical
    endpoint has a publicly trusted certificate.
    """
    canonical, https, httpswww = (domain.canonical, domain.https, domain.
        httpswww)
    if canonical.host == 'root':
        evaluate = https
    else:
        evaluate = httpswww
    return evaluate.live and evaluate.https_public_trusted
