Package org.apache.geronimo.crypto.asn1.x509

Examples of org.apache.geronimo.crypto.asn1.x509.V3TBSCertificateGenerator


    /**
     * reset the generator
     */
    public void reset()
    {
        tbsGen = new V3TBSCertificateGenerator();
        extGenerator.reset();
    }
View Full Code Here


        algorithms.put("ECDSAWITHSHA1", new DERObjectIdentifier("1.2.840.10045.4.1"));
    }

    public X509V3CertificateGenerator()
    {
        tbsGen = new V3TBSCertificateGenerator();
    }
View Full Code Here

    /**
     * reset the generator
     */
    public void reset()
    {
        tbsGen = new V3TBSCertificateGenerator();
        extensions = null;
        extOrdering = null;
    }
View Full Code Here

        algorithms.put("ECDSAWITHSHA1", new DERObjectIdentifier("1.2.840.10045.4.1"));
    }

    public X509V3CertificateGenerator()
    {
        tbsGen = new V3TBSCertificateGenerator();
    }
View Full Code Here

    /**
     * reset the generator
     */
    public void reset()
    {
        tbsGen = new V3TBSCertificateGenerator();
        extensions = null;
        extOrdering = null;
    }
View Full Code Here

    private Hashtable                   extensions = null;
    private Vector                      extOrdering = null;

    public X509V3CertificateGenerator()
    {
        tbsGen = new V3TBSCertificateGenerator();
    }
View Full Code Here

    /**
     * reset the generator
     */
    public void reset()
    {
        tbsGen = new V3TBSCertificateGenerator();
        extensions = null;
        extOrdering = null;
    }
View Full Code Here

   
    private TestResult tbsV3CertGen()
    {
        try
        {
            V3TBSCertificateGenerator   gen = new V3TBSCertificateGenerator();
            Date                        startDate = new Date(1000);
            Date                        endDate = new Date(2000);

            gen.setSerialNumber(new DERInteger(2));
           
            gen.setStartDate(new Time(startDate));
            gen.setEndDate(new Time(endDate));
           
            gen.setIssuer(new X509Name("CN=AU,O=Bouncy Castle"));
            gen.setSubject(new X509Name("CN=AU,O=Bouncy Castle,OU=Test 2"));
           
            gen.setSignature(new AlgorithmIdentifier(PKCSObjectIdentifiers.md5WithRSAEncryption, new DERNull()));
          
            SubjectPublicKeyInfo    info = new SubjectPublicKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(BigInteger.valueOf(1), BigInteger.valueOf(2))), new DERInteger(3));

            gen.setSubjectPublicKeyInfo(info);
           
            //
            // add extensions
            //
            Vector          order = new Vector();
            Hashtable       extensions = new Hashtable();
           
            order.addElement(X509Extensions.AuthorityKeyIdentifier);
            order.addElement(X509Extensions.SubjectKeyIdentifier);
            order.addElement(X509Extensions.KeyUsage);
           
            extensions.put(X509Extensions.AuthorityKeyIdentifier, new X509Extension(true, new DEROctetString(createAuthorityKeyId(info, new X509Name("CN=AU,O=Bouncy Castle,OU=Test 2"), 2))));
            extensions.put(X509Extensions.SubjectKeyIdentifier, new X509Extension(true, new DEROctetString(new SubjectKeyIdentifier(info))));
            extensions.put(X509Extensions.KeyUsage, new X509Extension(false, new DEROctetString(new KeyUsage(KeyUsage.dataEncipherment))));
           
            X509Extensions  ex = new X509Extensions(order, extensions);
           
            gen.setExtensions(ex);
           
            TBSCertificateStructure     tbs = gen.generateTBSCertificate();
            ByteArrayOutputStream       bOut = new ByteArrayOutputStream();
            ASN1OutputStream            aOut = new ASN1OutputStream(bOut);
           
            aOut.writeObject(tbs);
           
View Full Code Here

    private String                      signatureAlgorithm;
    private X509ExtensionsGenerator     extGenerator;

    public X509V3CertificateGenerator()
    {
        tbsGen = new V3TBSCertificateGenerator();
        extGenerator = new X509ExtensionsGenerator();
    }
View Full Code Here

    /**
     * reset the generator
     */
    public void reset()
    {
        tbsGen = new V3TBSCertificateGenerator();
        extGenerator.reset();
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.crypto.asn1.x509.V3TBSCertificateGenerator

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.