def mint(**kwargs):
    """
    Creates the authority based on the plugin provided.
    """
    issuer = kwargs["plugin"]["plugin_object"]
    values = issuer.create_authority(kwargs)

    # Check body for root cert
    if values[0] is None:
        raise ValueError(f"Plugin '{issuer.get_title()}' provided no root certification. Check plugin configuration.")

    # support older plugins
    if len(values) == 3:
        body, chain, roles = values
        private_key = None
    elif len(values) == 4:
        body, private_key, chain, roles = values

    roles = create_authority_roles(
        roles,
        kwargs["owner"],
        kwargs["plugin"]["plugin_object"].title,
        kwargs["creator"],
    )

    log_service.audit_log("create_authority_with_issuer", issuer.title, "Created new authority")
    return body, private_key, chain, roles

    Creates the authority based on the plugin provided.
    
lemur/authorities/service.py