logsession.log(admin, admin.getCAId(), LogEntry.MODULE_KEYRECOVERY, new java.util.Date(),
logsession.log(admin, admin.getCaId(), LogEntry.MODULE_KEYRECOVERY, new java.util.Date(),
    public boolean markNewestAsRecoverable(Admin admin, String username) {        debug(">markNewestAsRecoverable(user: " + username + ")");        boolean returnval = false;        long newesttime = 0;        KeyRecoveryDataLocal krd = null;        KeyRecoveryDataLocal newest = null;        X509Certificate certificate = null;        X509Certificate newestcertificate = null;        if (!isUserMarked(admin, username)) {            try {                Collection result = keyrecoverydatahome.findByUsername(username);                Iterator iter = result.iterator();                while (iter.hasNext()) {                    krd = (KeyRecoveryDataLocal) iter.next();                    certificate = (X509Certificate) certificatestoresession                            .findCertificateByIssuerAndSerno(admin,                                    krd.getIssuerDN(), krd.getCertificateSN());                    if (certificate != null) {                        if (certificate.getNotBefore().getTime() > newesttime) {                            newesttime = certificate.getNotBefore().getTime();                            newest = krd;                            newestcertificate = certificate;                        }                    }                }                if (newest != null) {                    newest.setMarkedAsRecoverable(true);                    returnval = true;                }                logsession.log(admin, admin.getCAId(), LogEntry.MODULE_KEYRECOVERY, new java.util.Date(),                        username, newestcertificate, LogEntry.EVENT_INFO_KEYRECOVERY,                        "User's newest certificate marked for recovery.");            } catch (Exception e) {                logsession.log(admin, admin.getCAId(), LogEntry.MODULE_KEYRECOVERY, new java.util.Date(),                        username, null, LogEntry.EVENT_ERROR_KEYRECOVERY,                        "Error when trying to mark users newest certificate for recovery.");            }        }        debug("<markNewestAsRecoverable()");        return returnval;    } // markNewestAsRecoverable