KeyRecoveryCAServiceResponse response = (KeyRecoveryCAServiceResponse) getSignSession().extendedService(admin, caid,
KeyRecoveryCAServiceResponse response = (KeyRecoveryCAServiceResponse) signsession.extendedService(admin, caid,
    public boolean changeKeyRecoveryData(Admin admin, X509Certificate certificate,                                         boolean markedasrecoverable, KeyPair keypair) {        debug(">changeKeyRecoveryData(certsn: " + certificate.getSerialNumber().toString() + ", " +                CertTools.getIssuerDN(certificate) + ")");        boolean returnval = false;        final String hexSerial = certificate.getSerialNumber().toString(16);        final String dn = CertTools.getIssuerDN(certificate);        try {            KeyRecoveryDataLocal krd = keyrecoverydatahome.findByPrimaryKey(new KeyRecoveryDataPK(hexSerial, dn));            krd.setMarkedAsRecoverable(markedasrecoverable);            int caid = dn.hashCode();            KeyRecoveryCAServiceResponse response = (KeyRecoveryCAServiceResponse) getSignSession().extendedService(admin, caid,                    new KeyRecoveryCAServiceRequest(KeyRecoveryCAServiceRequest.COMMAND_ENCRYPTKEYS, keypair));            krd.setKeyDataFromByteArray(response.getKeyData());            getLogSession().log(admin, certificate, LogEntry.MODULE_KEYRECOVERY, new java.util.Date(),                    krd.getUsername(), certificate, LogEntry.EVENT_INFO_KEYRECOVERY,                    "Keyrecovery data for certificate with serial number : " +                    hexSerial + ", " +                    dn + " changed.");            returnval = true;        } catch (Exception e) {            getLogSession().log(admin, certificate, LogEntry.MODULE_KEYRECOVERY, new java.util.Date(), null,                    certificate, LogEntry.EVENT_ERROR_KEYRECOVERY,                    "Error when trying to update keyrecovery data for certificate with serial number : " +                    hexSerial + ", " +                    dn + ".");        }        debug("<changeKeyRecoveryData()");        return returnval;    } // changeKeyRecoveryData