getAdminSession().setUserStatus(administrator, username, UserDataConstants.STATUS_KEYRECOVERY);
getAdminSession().setUserStatus(administrator, username, UserDataConstants.STATUS_KEYRECOVERY,false);
    public void execute() throws IllegalAdminCommandException, ErrorAdminCommandException {        try {            if (args.length != 3) {                getOutputStream().println("Usage: RA keyrecover <CertificateSN (HEX)> <IssuerDN>");                return;            }            //InitialContext jndicontext = new InitialContext();            InitialContext jndicontext = getInitialContext();            Object obj1 = jndicontext.lookup("CertificateStoreSession");            ICertificateStoreSessionHome certificatesessionhome = (ICertificateStoreSessionHome) javax.rmi.PortableRemoteObject.narrow(obj1,                    ICertificateStoreSessionHome.class);            ICertificateStoreSessionRemote certificatesession = certificatesessionhome.create();            obj1 = jndicontext.lookup("KeyRecoverySession");            IKeyRecoverySessionHome keyrecoverysessionhome = (IKeyRecoverySessionHome) javax.rmi.PortableRemoteObject.narrow(jndicontext.lookup(                        "KeyRecoverySession"), IKeyRecoverySessionHome.class);            IKeyRecoverySessionRemote keyrecoverysession = keyrecoverysessionhome.create();            BigInteger certificatesn = new BigInteger(args[1], 16);            String issuerdn = args[2];             boolean usekeyrecovery = getRaAdminSession().loadGlobalConfiguration(administrator).getEnableKeyRecovery();               if(!usekeyrecovery){               getOutputStream().println("Keyrecovery have to be enabled in the system configuration in order to use this command.");               return;                                }                              X509Certificate cert = (X509Certificate) certificatesession.findCertificateByIssuerAndSerno(                                                                             administrator, issuerdn,                                                                              certificatesn);                           if(cert == null){               getOutputStream().println("Certificate couldn't be found in database.");               return;                           }                           String username = certificatesession.findUsernameByCertSerno(administrator, certificatesn, issuerdn);                           if(!keyrecoverysession.existsKeys(administrator,cert)){               getOutputStream().println("Specified keys doesn't exist in database.");               return;                               }                           if(keyrecoverysession.isUserMarked(administrator,username)){               getOutputStream().println("User is already marked for recovery.");               return;                                  }               keyrecoverysession.markAsRecoverable(administrator,                                                   cert);                     getAdminSession().setUserStatus(administrator, username, UserDataConstants.STATUS_KEYRECOVERY);               getOutputStream().println("Keys corresponding to given certificate has been marked for recovery.");                                   } catch (Exception e) {            throw new ErrorAdminCommandException(e);        }    }