}
} else {  index = name.indexOf('+'); if (index > 0) { ret = name.substring(0, index); } }
    public String getUsername() {        if (username != null)            return username;        String name = CertTools.getPartFromDN(getRequestDN(), "CN");        if (name == null) {            log.error("No CN in DN: "+getRequestDN());            return null;        }        // Special if the DN contains unstructuredAddress where it becomes:         // CN=pix.primekey.se + unstructuredAddress=pix.primekey.se        // We only want the CN and not the oid-part.        String ret = name;        if (name != null) {            int index = name.indexOf(' ');            if (index > 0) {                ret = name.substring(0, index);            }                    }        log.debug("UserName='" + ret + "'");        return ret;    }