class AthenzUtils {

    public static String[] splitPrincipalName(String name) {
        // all the role members in Athens are normalized to lower case
        String principalName = name.toLowerCase();
        int idx = principalName.lastIndexOf(AuthorityConsts.ATHENZ_PRINCIPAL_DELIMITER_CHAR);
        if (idx == -1 || idx == 0 || idx == principalName.length() - 1) {
            return null;
        }

        return new String[]{principalName.substring(0, idx), principalName.substring(idx + 1)};
    }

    private  AthenzUtils();

}