Examples of AttributeCertificateIssuer


Examples of org.bouncycastle.x509.AttributeCertificateIssuer

        X509Attribute attributes = new X509Attribute("2.5.24.72",
                new DERSequence(roleSyntax));

        gen.addAttribute(attributes);
        gen.setHolder(new AttributeCertificateHolder(iCert));
        gen.setIssuer(new AttributeCertificateIssuer(new X509Principal("cn=test")));
        gen.setNotBefore(new Date(System.currentTimeMillis() - 50000));
        gen.setNotAfter(new Date(System.currentTimeMillis() + 50000));
        gen.setSerialNumber(BigInteger.ONE);
        gen.setSignatureAlgorithm("SHA1WithRSAEncryption");
       
View Full Code Here

Examples of org.bouncycastle.x509.AttributeCertificateIssuer

        X509Attribute attributes = new X509Attribute("2.5.24.72",
                new DERSequence(roleSyntax));
   
        gen.addAttribute(attributes);
        gen.setHolder(new AttributeCertificateHolder(iCert.getSubjectX500Principal()));
        gen.setIssuer(new AttributeCertificateIssuer(new X509Principal("cn=test")));
        gen.setNotBefore(new Date(System.currentTimeMillis() - 50000));
        gen.setNotAfter(new Date(System.currentTimeMillis() + 50000));
        gen.setSerialNumber(BigInteger.ONE);
        gen.setSignatureAlgorithm("SHA1WithRSAEncryption");
       
View Full Code Here

Examples of org.bouncycastle.x509.AttributeCertificateIssuer

        //
        aCert = new X509V2AttributeCertificate(aCert.getEncoded());
       
        aCert.verify(pubKey, "BC");
       
        AttributeCertificateIssuer  issuer = aCert.getIssuer();
       
        Principal[] principals = issuer.getPrincipals();
       
        //
        // test holder
        //
        AttributeCertificateHolder holder = aCert.getHolder();
View Full Code Here

Examples of org.bouncycastle.x509.AttributeCertificateIssuer

        // Holder: here we use the IssuerSerial form
        //
        acGen.setHolder(new AttributeCertificateHolder(clientCert));

        // set the Issuer
        acGen.setIssuer(new AttributeCertificateIssuer(caCert.getSubjectX500Principal()));

        //
        // serial number (as it's an example we don't have to keep track of the
        // serials anyway
        //
        acGen.setSerialNumber(new BigInteger("1"));

        // not Before
        acGen.setNotBefore(new Date(System.currentTimeMillis() - 50000));

        // not After
        acGen.setNotAfter(new Date(System.currentTimeMillis() + 50000));

        // signature Algorithmus
        acGen.setSignatureAlgorithm("SHA1WithRSAEncryption");

        // the actual attributes
        GeneralName roleName = new GeneralName(GeneralName.rfc822Name, "DAU123456789");
        ASN1EncodableVector roleSyntax = new ASN1EncodableVector();
        roleSyntax.add(roleName);

        // roleSyntax OID: 2.5.24.72
        X509Attribute attributes = new X509Attribute("2.5.24.72",
                new DERSequence(roleSyntax));

        acGen.addAttribute(attributes);

        //      finally create the AC
        X509V2AttributeCertificate att = (X509V2AttributeCertificate)acGen
                .generate(caPrivKey, "BC");

        //
        // starting here, we parse the newly generated AC
        //

        // Holder

        AttributeCertificateHolder h = att.getHolder();
        if (h.match(clientCert))
        {
            if (h.getEntityNames() != null)
            {
                System.out.println(h.getEntityNames().length + " entity names found");
            }
            if (h.getIssuer() != null)
            {
                System.out.println(h.getIssuer().length + " issuer names found, serial number " + h.getSerialNumber());
            }
            System.out.println("Matches original client x509 cert");
        }

        // Issuer
       
        AttributeCertificateIssuer issuer = att.getIssuer();
        if (issuer.match(caCert))
        {
            if (issuer.getPrincipals() != null)
            {
                System.out.println(issuer.getPrincipals().length + " entity names found");
            }
            System.out.println("Matches original ca x509 cert");
        }
       
        // Dates
View Full Code Here

Examples of org.bouncycastle.x509.AttributeCertificateIssuer

        X509Attribute attributes = new X509Attribute("2.5.24.72",
            new DERSequence(roleSyntax));

        gen.addAttribute(attributes);
        gen.setHolder(new AttributeCertificateHolder(PrincipalUtil.getSubjectX509Principal(iCert)));
        gen.setIssuer(new AttributeCertificateIssuer(new X509Principal(
            "cn=test")));
        gen.setNotBefore(new Date(System.currentTimeMillis() - 50000));
        gen.setNotAfter(new Date(System.currentTimeMillis() + 50000));
        gen.setSerialNumber(BigInteger.valueOf(1));
        gen.setSignatureAlgorithm("SHA1WithRSAEncryption");
View Full Code Here

Examples of org.bouncycastle.x509.AttributeCertificateIssuer

        X509Attribute attributes = new X509Attribute("2.5.24.72",
            new DERSequence(roleSyntax));

        gen.addAttribute(attributes);
        gen.setHolder(new AttributeCertificateHolder(PrincipalUtil.getSubjectX509Principal(iCert)));
        gen.setIssuer(new AttributeCertificateIssuer(new X509Principal(
            "cn=test")));
        gen.setNotBefore(new Date(System.currentTimeMillis() - 50000));
        gen.setNotAfter(new Date(System.currentTimeMillis() + 50000));
        gen.setSerialNumber(BigInteger.ONE);
        gen.setSignatureAlgorithm("SHA1WithRSAEncryption");
View Full Code Here

Examples of org.bouncycastle.x509.AttributeCertificateIssuer

        X509Attribute attributes = new X509Attribute("2.5.24.72",
                new DERSequence(roleSyntax));

        gen.addAttribute(attributes);
        gen.setHolder(new AttributeCertificateHolder(iCert));
        gen.setIssuer(new AttributeCertificateIssuer(new X509Principal("cn=test")));
        gen.setNotBefore(new Date(System.currentTimeMillis() - 50000));
        gen.setNotAfter(new Date(System.currentTimeMillis() + 50000));
        gen.setSerialNumber(BigInteger.ONE);
        gen.setSignatureAlgorithm("SHA1WithRSAEncryption");
       
View Full Code Here

Examples of org.bouncycastle.x509.AttributeCertificateIssuer

        X509Attribute attributes = new X509Attribute("2.5.24.72",
                new DERSequence(roleSyntax));
   
        gen.addAttribute(attributes);
        gen.setHolder(new AttributeCertificateHolder(iCert.getSubjectX500Principal()));
        gen.setIssuer(new AttributeCertificateIssuer(new X509Principal("cn=test")));
        gen.setNotBefore(new Date(System.currentTimeMillis() - 50000));
        gen.setNotAfter(new Date(System.currentTimeMillis() + 50000));
        gen.setSerialNumber(BigInteger.ONE);
        gen.setSignatureAlgorithm("SHA1WithRSAEncryption");
       
View Full Code Here

Examples of org.bouncycastle.x509.AttributeCertificateIssuer

        //
        aCert = new X509V2AttributeCertificate(aCert.getEncoded());
       
        aCert.verify(pubKey, "BC");
       
        AttributeCertificateIssuer  issuer = aCert.getIssuer();
       
        Principal[] principals = issuer.getPrincipals();
       
        //
        // test holder
        //
        AttributeCertificateHolder holder = aCert.getHolder();
View Full Code Here

Examples of org.bouncycastle.x509.AttributeCertificateIssuer

        X509Attribute attributes = new X509Attribute("2.5.24.72",
                new DERSequence(roleSyntax));

        gen.addAttribute(attributes);
        gen.setHolder(new AttributeCertificateHolder(iCert));
        gen.setIssuer(new AttributeCertificateIssuer(new X509Principal("cn=test")));
        gen.setNotBefore(new Date(System.currentTimeMillis() - 50000));
        gen.setNotAfter(new Date(System.currentTimeMillis() + 50000));
        gen.setSerialNumber(BigInteger.ONE);
        gen.setSignatureAlgorithm("SHA1WithRSAEncryption");
       
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.