usersession.setUserStatus(admin,"foo",UserDataConstants.STATUS_NEW);
usersession.setUserStatus(admin,"foo",UserDataConstants.STATUS_NEW, false);
    public void test06KeyUsage() throws Exception {        log.debug(">test06KeyUsage()");        usersession.setUserStatus(admin,"foo",UserDataConstants.STATUS_NEW);        log.debug("Reset status of 'foo' to NEW");        // Create an array for KeyUsage acoording to X509Certificate.getKeyUsage()        boolean[] keyusage1 = new boolean[9];        Arrays.fill(keyusage1, false);        // digitalSignature        keyusage1[0] = true;        // keyEncipherment        keyusage1[2] = true;        X509Certificate cert = (X509Certificate) remote.createCertificate(admin, "foo", "foo123", keys.getPublic(), keyusage1);        assertNotNull("Misslyckades skapa cert", cert);        log.debug("Cert=" + cert.toString());        boolean[] retKU = cert.getKeyUsage();        assertTrue("Fel KeyUsage, digitalSignature finns ej!", retKU[0]);        assertTrue("Fel KeyUsage, keyEncipherment finns ej!", retKU[2]);        assertTrue("Fel KeyUsage, cRLSign finns!", !retKU[6]);        usersession.setUserStatus(admin,"foo",UserDataConstants.STATUS_NEW);        log.debug("Reset status of 'foo' to NEW");        boolean[] keyusage2 = new boolean[9];        Arrays.fill(keyusage2, false);        // keyCertSign        keyusage2[5] = true;        // cRLSign        keyusage2[6] = true;        X509Certificate cert1 = (X509Certificate) remote.createCertificate(admin, "foo", "foo123", keys.getPublic(), keyusage2);        assertNotNull("Misslyckades skapa cert", cert1);        retKU = cert1.getKeyUsage();        assertTrue("Fel KeyUsage, keyCertSign finns ej!", retKU[5]);        assertTrue("Fel KeyUsage, cRLSign finns ej!", retKU[6]);        assertTrue("Fel KeyUsage, digitalSignature finns!", !retKU[0]);        log.debug("Cert=" + cert1.toString());        log.debug("<test06KeyUsage()");    }