usersession.setUserStatus(admin,"foo",UserDataConstants.STATUS_NEW, false);
usersession.setUserStatus(admin,"foo",UserDataConstants.STATUS_NEW);
    public void test03TestBCPKCS10() throws Exception {        log.debug(">test03TestBCPKCS10()");        usersession.setUserStatus(admin,"foo",UserDataConstants.STATUS_NEW, false);        log.debug("Reset status of 'foo' to NEW");        // Create certificate request        ExtendedPKCS10CertificationRequest req = new ExtendedPKCS10CertificationRequest("SHA1WithRSA",                CertTools.stringToBcX509Name("C=SE, O=AnaTom, CN=foo"), keys.getPublic(), null,                keys.getPrivate());        ByteArrayOutputStream bOut = new ByteArrayOutputStream();        DEROutputStream dOut = new DEROutputStream(bOut);        dOut.writeObject(req);        dOut.close();        ExtendedPKCS10CertificationRequest req2 = new ExtendedPKCS10CertificationRequest(bOut.toByteArray());        boolean verify = req2.verify();        log.debug("Verify returned " + verify);        if (verify == false) {            log.debug("Aborting!");            return;        }        log.debug("CertificationRequest generated successfully.");        byte[] bcp10 = bOut.toByteArray();        PKCS10RequestMessage p10 = new PKCS10RequestMessage(bcp10);        p10.setUsername("foo");        p10.setPassword("foo123");        IResponseMessage resp = remote.createCertificate(admin,                p10, Class.forName("org.ejbca.core.protocol.X509ResponseMessage"));        X509Certificate cert = CertTools.getCertfromByteArray(resp.getResponseMessage());        assertNotNull("Failed to create certificate", cert);        log.debug("Cert=" + cert.toString());        log.debug("<test03TestBCPKCS10()");    }