String sn = CertTools.getPartFromDN(dn, "SN");
String sn = CertTools.getPartFromDN(dn, "SURNAME"); if (person) { if ( (sn == null) && (cn != null) ) {  int index = cn.indexOf(' '); if (index <=0) {  sn = cn; } else { if (index < cn.length()) sn = cn.substring(index); } } }
    private LDAPModificationSet getModificationSet(LDAPEntry oldEntry, String dn, boolean extra) {        LDAPModificationSet modSet = new LDAPModificationSet();        if (extra) {            String cn = CertTools.getPartFromDN(dn, "CN");            if (cn != null) {                modSet.add(LDAPModification.REPLACE, new LDAPAttribute("cn", cn));            }            String sn = CertTools.getPartFromDN(dn, "SN");            if (sn != null) {                modSet.add(LDAPModification.REPLACE, new LDAPAttribute("sn", sn));            }            String l = CertTools.getPartFromDN(dn, "L");            if (l != null) {                modSet.add(LDAPModification.REPLACE, new LDAPAttribute("l", l));            }            String st = CertTools.getPartFromDN(dn, "ST");            if (st != null) {                modSet.add(LDAPModification.REPLACE, new LDAPAttribute("st", st));            }            String ou = CertTools.getPartFromDN(dn, "OU");            if (ou != null) {                modSet.add(LDAPModification.REPLACE, new LDAPAttribute("ou", ou));            }        }        return modSet;    }