def METHOD_NAME(cn_name, org_name=None, role=None):
    name = [x509.NameAttribute(NameOID.COMMON_NAME, cn_name)]
    if org_name is not None:
        name.append(x509.NameAttribute(NameOID.ORGANIZATION_NAME, org_name))
    if role:
        name.append(x509.NameAttribute(NameOID.UNSTRUCTURED_NAME, role))
    return x509.Name(name)