def certificate_name(common_name, issuer, not_before, not_after, san, domains=[]):
    """
    Create a name for our certificate. A naming standard
    is based on a series of templates. The name includes
    useful information such as Common Name, Validation dates,
    and Issuer.

    :param common_name:
    :param not_after:
    :param issuer:
    :param not_before:
    :param san:
    :param domains:
    :rtype: str
    :return:
    """
    if san:
        t = SAN_NAMING_TEMPLATE
    else:
        t = DEFAULT_NAMING_TEMPLATE

    if common_name and common_name.strip():
        subject = common_name
    elif len(domains):
        subject = domains[0].name

    temp = t.format(
        subject=subject,
        issuer=issuer.replace(" ", ""),
        not_before=not_before.strftime("%Y%m%d"),
        not_after=not_after.strftime("%Y%m%d"),
    )

    temp = temp.replace("*", "WILDCARD")
    return text_to_slug(temp)

    Create a name for our certificate. A naming standard
    is based on a series of templates. The name includes
    useful information such as Common Name, Validation dates,
    and Issuer.

    :param common_name:
    :param not_after:
    :param issuer:
    :param not_before:
    :param san:
    :param domains:
    :rtype: str
    :return:
    
lemur/common/defaults.py