Package org.bouncycastle.x509

Examples of org.bouncycastle.x509.X509V2CRLGenerator.generate()


       
        crlGen.addCRLEntry(BigInteger.valueOf(2), now, entryExtensions);
       
        crlGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(pair.getPublic()));
       
        X509CRL    newCrl = crlGen.generate(pair.getPrivate(), "BC");
       
        int     count = 0;
        boolean oneFound = false;
        boolean twoFound = false;
       
View Full Code Here


        g.setThisUpdate(new Date());
        g.setNextUpdate(Util.tomorrow());
        g.setSignatureAlgorithm("SHA1withRSA");
        g.addExtension(X509Extensions.CRLNumber, false,
            new CRLNumber(BigInteger.TEN));
        X509CRL x509crl = g.generate(kp.getPrivate());

        List<CertificateSerial> serials = getStubCSList();
        List<X509CRLEntryWrapper> entries = Util.newList();
        for (CertificateSerial serial : serials) {
            entries.add(new X509CRLEntryWrapper(serial.getSerial(),
View Full Code Here

        g.setNextUpdate(Util.tomorrow());
        g.setSignatureAlgorithm("SHA1withRSA");
        g.addExtension(X509Extensions.CRLNumber, false,
            new CRLNumber(BigInteger.TEN));

        X509CRL x509crl = g.generate(kp.getPrivate());

        assertEquals("10", pkiUtility.decodeDERValue(x509crl.getExtensionValue(
            X509Extensions.CRLNumber.getId())));
    }
View Full Code Here

        g.setNextUpdate(Util.tomorrow());
        g.setSignatureAlgorithm("SHA1withRSA");
        g.addExtension(X509Extensions.CRLNumber, false,
            new CRLNumber(BigInteger.TEN));

        X509CRL x509crl = g.generate(KP.getPrivate());
        assertEquals(BigInteger.TEN, this.generator.getCRLNumber(x509crl));
    }

    @Test
    public void serialsTransfered() {
View Full Code Here

        g.setThisUpdate(new Date());
        g.setNextUpdate(Util.tomorrow());
        g.setSignatureAlgorithm("SHA1withRSA");
        g.addExtension(X509Extensions.CRLNumber, false,
            new CRLNumber(BigInteger.TEN));
        X509CRL x509crl = g.generate(kp.getPrivate());

        // now we need to remove one of those serials
        List<CertificateSerial> toremove = new ArrayList<CertificateSerial>() {
            {
                add(stubCS(100L, new Date()));
View Full Code Here

            log.info("Completed adding CRL numbers to the certificate.");
            generator.addExtension(X509Extensions.AuthorityKeyIdentifier,
                false, new AuthorityKeyIdentifierStructure(caCert));
            generator.addExtension(X509Extensions.CRLNumber, false,
                new CRLNumber(crlNumber));
            return generator.generate(reader.getCaKey());
        }
        catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

        crlGen.addCRLEntry(BigInteger.ONE, now, CRLReason.privilegeWithdrawn);

        crlGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(pair.getPublic()));

        return crlGen.generate(pair.getPrivate(), "BC");
    }

    /* 
     * 
     *  INTERNAL METHODS
View Full Code Here

       
        crlGen.addCRLEntry(BigInteger.ONE, now, CRLReason.privilegeWithdrawn);
       
        crlGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(pair.getPublic()));
       
        X509CRL    crl = crlGen.generate(pair.getPrivate(), "BC");
       
        if (!crl.getIssuerX500Principal().equals(new X500Principal("CN=Test CA")))
        {
            fail("failed CRL issuer test");
        }
View Full Code Here

       
        crlGen.addCRLEntry(BigInteger.ONE, now, entryExtensions);
       
        crlGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(pair.getPublic()));
       
        X509CRL    crl = crlGen.generate(pair.getPrivate(), "BC");
       
        if (!crl.getIssuerX500Principal().equals(new X500Principal("CN=Test CA")))
        {
            fail("failed CRL issuer test");
        }
View Full Code Here

       
        crlGen.addCRLEntry(BigInteger.ONE, now, entryExtensions);
       
        crlGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(pair.getPublic()));
       
        X509CRL    crl = crlGen.generate(pair.getPrivate(), "BC");
       
        if (!crl.getIssuerX500Principal().equals(new X500Principal("CN=Test CA")))
        {
            fail("failed CRL issuer test");
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.