class AthenzUtils {

    public static String extractPrincipalServiceName(final String principalName) {
        int idx = principalName.lastIndexOf(AuthorityConsts.ATHENZ_PRINCIPAL_DELIMITER_CHAR);
        if (idx == -1 || idx == 0 || idx == principalName.length() - 1) {
            return null;
        } else {
            return principalName.substring(idx + 1);
        }
    }

    private  AthenzUtils();

}