Package org.bouncycastle.x509

Examples of org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate()


        certGen.setPublicKey(pubKey);
        certGen.setSignatureAlgorithm("MD5WithRSAEncryption");

        try
        {
            X509Certificate cert = certGen.generateX509Certificate(privKey);

            cert.checkValidity(new Date());

            cert.verify(pubKey);
View Full Code Here


        certGen.setNotAfter(new Date(System.currentTimeMillis() + (1000L * 60 * 60 * 24 * 30)));
        certGen.setSubjectDN(new X509Principal(attrs));
        certGen.setPublicKey(pubKey);
        certGen.setSignatureAlgorithm("MD5WithRSAEncryption");

        X509Certificate cert = certGen.generateX509Certificate(privKey);

        cert.checkValidity(new Date());

        cert.verify(pubKey);

View Full Code Here

        certGen.setNotAfter(new Date(System.currentTimeMillis() + (1000L * 60 * 60 * 24 * 30)));
        certGen.setSubjectDN(new X509Principal(attrs));
        certGen.setPublicKey(pubKey);
        certGen.setSignatureAlgorithm("MD5WithRSAEncryption");

        X509Certificate cert = certGen.generateX509Certificate(privKey);

        cert.checkValidity(new Date());

        cert.verify(pubKey);

View Full Code Here

        v3CertGen.addExtension(
            X509Extensions.AuthorityKeyIdentifier,
            false,
            createAuthorityKeyId(issPub));

        return v3CertGen.generateX509Certificate(issPriv);
    }

    public static void main(
        String args[])
        throws Exception
View Full Code Here

        v3CertGen.addExtension(
            X509Extensions.AuthorityKeyIdentifier,
            false,
            createAuthorityKeyId(issPub));

        return v3CertGen.generateX509Certificate(issPriv);
    }

    public static void main(
        String args[])
        throws Exception
View Full Code Here

        v3CertGen.addExtension(
            X509Extensions.AuthorityKeyIdentifier,
            false,
            createAuthorityKeyId(issPub));

        return v3CertGen.generateX509Certificate(issPriv);
    }

    public static void main(
        String args[])
        throws Exception
View Full Code Here

        certGen.setNotAfter(new Date(System.currentTimeMillis() + (1000L * 60 * 60 * 24 * 30)));
        certGen.setSubjectDN(new X509Principal(attrs));
        certGen.setPublicKey(pubKey);
        certGen.setSignatureAlgorithm("MD5WithRSAEncryption");

        X509Certificate cert = certGen.generateX509Certificate(privKey);

        cert.checkValidity(new Date());

        cert.verify(pubKey);

View Full Code Here

        certGen.setNotBefore(new Date(System.currentTimeMillis() - 50000));
        certGen.setNotAfter(new Date(System.currentTimeMillis() + 50000000));
        certGen.setSubjectDN(new X509Principal("CN=Software emul (EC Cert)"));
        certGen.setPublicKey((PublicKey)pubECKey);

        return certGen.generateX509Certificate((PrivateKey)privECKey);
    }
   
    public static void main(
        String[]    args)
    {
View Full Code Here

            v3CertGen.setSubjectDN(new X509Principal("CN=" + hostname + ", OU=None, O=None L=None, C=None"));
                       
            v3CertGen.setPublicKey(KPair.getPublic())
            v3CertGen.setSignatureAlgorithm("MD5WithRSAEncryption");  
           
            X509Certificate PKCertificate = v3CertGen.generateX509Certificate(KPair.getPrivate());
           
            // store the certificate containing the public key,this file is needed
            // to import the public key in other key store.
            File certFile = new File(keyStoreFile.getParentFile(),hostname+".cert");
            FileOutputStream fos = new FileOutputStream(certFile.getAbsoluteFile())
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.