Package org.apache.harmony.security.x509

Examples of org.apache.harmony.security.x509.CRLNumber


                 new AuthorityKeyIdentifier(
                         new SubjectPublicKeyInfo(
                                 new AlgorithmIdentifier("RSA"), this.caX509.getEncoded())));
       
        this.crlGen.addExtension(X509Extensions.CRLNumber,
                 false, new CRLNumber(BigInteger.ONE));

        return this.crlGen.generateX509CRL(this.caPrivate, "BC");
    }
View Full Code Here


                 new AuthorityKeyIdentifier(
                         new SubjectPublicKeyInfo(
                                 new AlgorithmIdentifier("RSA"), this.caX509.getEncoded())));
       
        this.crlGen.addExtension(X509Extensions.CRLNumber,
                 false, new CRLNumber(BigInteger.ONE));

        return this.crlGen.generateX509CRL(this.caPrivate, "BC");
    }
View Full Code Here

        X509CertificateHolder holder = new X509CertificateHolder(issuer.getEncoded());
        X509v2CRLBuilder crlBuilder = new X509v2CRLBuilder(holder.getIssuer(), new Date());
        crlBuilder.setNextUpdate(new Date(new Date().getTime() + 100000));
        JcaContentSignerBuilder contentBuilder = new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC");

        CRLNumber crlNumber = new CRLNumber(new BigInteger("1234"));
       
        crlBuilder.addExtension(Extension.cRLNumber, false, crlNumber);
        X509CRLHolder x509Crl = crlBuilder.build(contentBuilder.build(issuerPrivateKey));
        return new JcaX509CRLConverter().setProvider("BC").getCRL(x509Crl);
    }
View Full Code Here

        g.setIssuerDN(new X500Principal("CN=test, UID=" + UUID.randomUUID()));
        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());
        assertEquals(BigInteger.TEN, this.generator.getCRLNumber(x509crl));
    }
View Full Code Here

        g.setIssuerDN(new X500Principal("CN=test, UID=" + UUID.randomUUID()));
        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>() {
            {
View Full Code Here

        g.setIssuerDN(new X500Principal("CN=test, UID=" + UUID.randomUUID()));
        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) {
View Full Code Here

        g.setIssuerDN(new X500Principal("CN=test, UID=" + UUID.randomUUID()));
        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());

        assertEquals("10", pkiUtility.decodeDERValue(x509crl.getExtensionValue(
            X509Extensions.CRLNumber.getId())));
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

      X509Certificate certificate = bcRequest.getIssuerCertificate();
      AuthorityKeyIdentifier authorityKeyIdentifier = new JcaX509ExtensionUtils().createAuthorityKeyIdentifier(certificate);
      builder.addExtension(X509Extension.authorityKeyIdentifier, false, authorityKeyIdentifier);

      builder.addExtension(X509Extension.cRLNumber, false, new CRLNumber(bcRequest.getNumber()));

      if (bcRequest.getOldCrl() != null) {
        X509CRLHolder current = new X509CRLHolder(bcRequest.getOldCrl());
        builder.addCRL(current);
      }
View Full Code Here

                    try
                    {
                        if (oid.equals(X509Extensions.CRLNumber))
                        {
                            buf.append(
                                new CRLNumber(DERInteger.getInstance(
                                    dIn.readObject()).getPositiveValue()))
                                .append(nl);
                        }
                        else if (oid.equals(X509Extensions.DeltaCRLIndicator))
                        {
                            buf.append(
                                "Base CRL: "
                                    + new CRLNumber(DERInteger.getInstance(
                                        dIn.readObject()).getPositiveValue()))
                                .append(nl);
                        }
                        else if (oid
                            .equals(X509Extensions.IssuingDistributionPoint))
View Full Code Here

TOP

Related Classes of org.apache.harmony.security.x509.CRLNumber

Copyright © 2018 www.massapicom. 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.