nextUpdate.setTime(nextUpdate.getTime() - (crlperiod * 60 * 60 * 1000));
nextUpdate.setTime(nextUpdate.getTime() + (crlperiod * 60 * 60 * 1000));
    private X509CRL makeBCCRL(X509Name caname, long crlperiod, Vector certs, int crlnumber)    throws Exception {        debug(">makeBCCRL()");        final String sigAlg="SHA1WithRSA";        Date thisUpdate = new Date();        Date nextUpdate = new Date();        // crlperiod is hours = crlperiod*60*60*1000 milliseconds        nextUpdate.setTime(nextUpdate.getTime() - (crlperiod * 60 * 60 * 1000));        X509V2CRLGenerator crlgen = new X509V2CRLGenerator();        crlgen.setThisUpdate(thisUpdate);        crlgen.setNextUpdate(nextUpdate);        crlgen.setSignatureAlgorithm(sigAlg);        // Make DNs        debug("Issuer="+caname);        crlgen.setIssuerDN(caname);        if (certs != null) {            debug("Number of revoked certificates: "+certs.size());            Iterator it = certs.iterator();            while( it.hasNext() ) {                RevokedCertInfo certinfo = (RevokedCertInfo)it.next();                crlgen.addCRLEntry(certinfo.getUserCertificate(), certinfo.getRevocationDate(), certinfo.getReason());            }        }        // Authority key identifier        if (useaki.booleanValue() == true) {            SubjectPublicKeyInfo apki = new SubjectPublicKeyInfo((DERConstructedSequence)new DERInputStream(                new ByteArrayInputStream(caCert.getPublicKey().getEncoded())).readObject());            AuthorityKeyIdentifier aki = new AuthorityKeyIdentifier(apki);            crlgen.addExtension(X509Extensions.AuthorityKeyIdentifier.getId(), akicritical.booleanValue(), aki);        }        // CRLNumber extension        if (usecrln.booleanValue() == true) {            CRLNumber crlnum = new CRLNumber(BigInteger.valueOf(crlnumber));            crlgen.addExtension(X509Extensions.CRLNumber.getId(), crlncritical.booleanValue(), crlnum);        }        X509CRL crl = crlgen.generateX509CRL(privateKey);        debug("<makeBCCRL()");        return (X509CRL)crl;    } // makeBCCRL