} else {  index = name.indexOf('+'); if (index > 0) { ret = name.substring(0, index); }
    public String getUsername() {        log.debug(">getUsername()");        String ret = null;        try {            if (pkcs10 == null) {                init();                decrypt();            }            ret = super.getUsername();            if (ret == null) {                // For Cisco boxes they can sometimes send DN as SN instead of CN                String name = CertTools.getPartFromDN(getRequestDN(), "SN");                if (name == null) {                    log.error("No SN in DN: "+getRequestDN());                    return null;                }                // Special if the DN contains unstructuredAddress where it becomes:                 // SN=1728668 + 1.2.840.113549.1.9.2=pix.primekey.se                // We only want the SN and not the oid-part.                int index = name.indexOf(' ');                ret = name;                 if (index > 0) {                    ret = name.substring(0,index);                        }            }        } catch (IOException e) {            log.error("PKCS7 not inited!");        } catch (GeneralSecurityException e) {            log.error("Error in PKCS7:", e);        } catch (CMSException e) {            log.error("Error in PKCS7:", e);        }        log.debug("<getUsername(): " + ret);        return ret;    }