getLogSession().log(admin, certificate, LogEntry.MODULE_KEYRECOVERY, new java.util.Date(),
logsession.log(admin, certificate, LogEntry.MODULE_KEYRECOVERY, new java.util.Date(),
    public boolean addKeyRecoveryData(Admin admin, X509Certificate certificate, String username,                                      KeyPair keypair) {        debug(">addKeyRecoveryData(user: " + username + ")");        boolean returnval = false;        try {            int caid = CertTools.getIssuerDN(certificate).hashCode();            KeyRecoveryCAServiceResponse response = (KeyRecoveryCAServiceResponse) getSignSession().extendedService(admin, caid,                    new KeyRecoveryCAServiceRequest(KeyRecoveryCAServiceRequest.COMMAND_ENCRYPTKEYS, keypair));            keyrecoverydatahome.create(certificate.getSerialNumber(),                    CertTools.getIssuerDN(certificate), username, response.getKeyData());            getLogSession().log(admin, certificate, LogEntry.MODULE_KEYRECOVERY, new java.util.Date(), username,                    certificate, LogEntry.EVENT_INFO_KEYRECOVERY,                    "Keyrecovery data for certificate with serial number : " +                    certificate.getSerialNumber().toString(16) + ", " +                    CertTools.getIssuerDN(certificate) + " added.");            returnval = true;        } catch (Exception e) {            getLogSession().log(admin, certificate, LogEntry.MODULE_KEYRECOVERY, new java.util.Date(),                    username, certificate, LogEntry.EVENT_ERROR_KEYRECOVERY,                    "Error when trying to add keyrecovery data for certificate with serial number : " +                    certificate.getSerialNumber().toString(16) + ", " +                    CertTools.getIssuerDN(certificate) + ".");        }        debug("<addKeyRecoveryData()");        return returnval;    } // addKeyRecoveryData