/*
    public boolean storeCRL(Admin admin, byte[] incrl, String cafp, int number) {        int ldapVersion = LDAPConnection.LDAP_V3;        LDAPConnection lc = new LDAPConnection();        X509CRL crl = null;        String dn = null;        try {            crl = CertTools.getCRLfromByteArray(incrl);            // Extract the users DN from the crl.            dn = CertTools.getIssuerDN(crl);        } catch (Exception e) {            error("Error decoding input CRL: ", e);                        logsession.log(admin, admin.getCAId(),LogEntry.MODULE_CA, new java.util.Date(), null, null,                    LogEntry.EVENT_ERROR_STORECRL, "Error decoding input CRL.");            return false;        }        if (checkContainerName(dn) == false) {            info("DN not part of containername, aborting store operation.");                            logsession.log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null,                    LogEntry.EVENT_ERROR_STORECRL,                    "DN not part of containername, aborting store operation.");            return false;        }        // Check if the entry is already present, we will update it with the new certificate.        LDAPEntry oldEntry = null;        try {            // connect to the server            lc.connect(ldapHost, ldapPort);            // authenticate to the server            lc.bind(ldapVersion, loginDN, loginPassword);            // try to read the old object            oldEntry = lc.read(dn);            // disconnect with the server            lc.disconnect();        } catch (LDAPException e) {            if (e.getLDAPResultCode() == LDAPException.NO_SUCH_OBJECT) {                debug("No old entry exist for '" + dn + "'.");            } else {                error("Error binding to and reading from LDAP server: ", e);                               logsession.log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null,                        LogEntry.EVENT_ERROR_STORECRL,                        "Error binding to and reading from LDAP server.");                return false;            }        }        LDAPEntry newEntry = null;        LDAPModificationSet modSet = null;        LDAPAttributeSet attributeSet = null;        if (oldEntry != null) {            modSet = getModificationSet(oldEntry, dn, false);        } else {            attributeSet = getAttributeSet(cAObjectclass, dn, false);        }        try {            LDAPAttribute crlAttr = new LDAPAttribute(cRLAttribute, crl.getEncoded());            if (oldEntry != null) {                modSet.add(LDAPModification.REPLACE, crlAttr);            } else {                attributeSet.add(crlAttr);            }        } catch (CRLException e) {            error("Error encoding CRL when storing in LDAP: ", e);                        logsession.log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null,                    LogEntry.EVENT_ERROR_STORECRL, "Error encoding CRL when storing in LDAP.");            return false;        }        if (oldEntry == null) {            newEntry = new LDAPEntry(dn, attributeSet);        }        try {            // connect to the server            lc.connect(ldapHost, ldapPort);            // authenticate to the server            lc.bind(ldapVersion, loginDN, loginPassword);            // Add or modify the entry            if (oldEntry != null) {                lc.modify(dn, modSet);                debug("\nModified object: " + dn + " successfully.");                                logsession.log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null,                        LogEntry.EVENT_INFO_STORECRL,                        "Modified object: " + dn + " successfully in LDAP.");            } else {                lc.add(newEntry);                debug("\nAdded object: " + dn + " successfully.");                                logsession.log(admin, crl.getIssuerDN().toString().hashCode(), LogEntry.MODULE_CA, new java.util.Date(), null, null,                        LogEntry.EVENT_INFO_STORECRL,                        "Added object: " + dn + " successfully in LDAP.");            }            // disconnect with the server            lc.disconnect();        } catch (LDAPException e) {            error("Error storing CRL (" + cRLAttribute + ") in LDAP (" + cAObjectclass + "): ", e);                        logsession.log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null,                    LogEntry.EVENT_ERROR_STORECRL,                    "Error storing CRL (" + cRLAttribute + ") in LDAP (" + cAObjectclass + ").");                        return false;        }        return true;    }