Package org.apache.harmony.security.provider.cert

Examples of org.apache.harmony.security.provider.cert.X509CertImpl


        String sigProvider = (param.getSigProvider() != null) ? param
                .getSigProvider() : provider;

        if (selfSigned) {
            // generate the certificate
            X509CertImpl x509cert = genX509CertImpl(sigAlgName, version,
                    serialNr, subjectDN, subjectDN, validity, keyPair
                            .getPublic(), privateKey, sigProvider,
                    param.isCA());

            // put the key pair with the newly created cert into the keystore
            keyStore.setKeyEntry(param.getAlias(), privateKey, param
                    .getKeyPass(), new X509Certificate[] { x509cert });

        } else {
            // generate the certificate
            X509CertImpl x509cert = genX509CertImpl(sigAlgName, version,
                    serialNr, subjectDN, issuerDN, validity, keyPair
                            .getPublic(), issuerPrivateKey,
                    sigProvider, param.isCA());

            // construct the certificate chain
View Full Code Here


                .valueOf(randomInt);

        // generate a new certificate
        String sigProvider = (param.getSigProvider() != null) ? param
                .getSigProvider() : param.getProvider();
        X509CertImpl x509cert = genX509CertImpl(sigAlgName, version, serialNr,
                distinguishedName, distinguishedName, validity, existing
                        .getPublicKey(), privateKey, sigProvider, param.isCA());

        if (param.isVerbose()) {
            System.out.println("New self-signed certificate: ");
            System.out.println("Version: v" + x509cert.getVersion());
            System.out.println("Owner: " + x509cert.getSubjectX500Principal());
            System.out.println("Issuer: " + x509cert.getIssuerX500Principal());
            System.out.println("Public key: " + x509cert.getPublicKey());
            System.out
                    .println("Signature algorithm: OID."
                            + x509cert.getSigAlgOID() + ", "
                            + x509cert.getSigAlgName());
            System.out
                    .println("Serial number: "
                            // String.format("%x", x509cert.getSerialNumber()));
                            // TODO: print with String.format(..) when the
                            // method is
                            // implemented, and remove Integer.toHexString(..).
                            + Integer.toHexString(x509cert.getSerialNumber()
                                    .intValue()));

            System.out.println("Validity: \n    From: "
                    + x509cert.getNotBefore() + "\n      To: "
                    + x509cert.getNotAfter());
        }

        // put the new certificate into the entry, associated with the alias
        keyStore.setKeyEntry(alias, privateKey, param.getKeyPass(),
                new X509Certificate[] { x509cert });
View Full Code Here

        // actual X.509 certificate generation
        org.apache.harmony.security.x509.Certificate cert;
        cert = new org.apache.harmony.security.x509.Certificate(tbsCertificate,
                algId, signatureValue);
        return new X509CertImpl(cert);
    }
View Full Code Here

            return null;
        }
        X509Certificate[] certs = new X509Certificate[encCerts.size()];
        int i = 0;
        for (Iterator it = encCerts.iterator(); it.hasNext();) {
            certs[i++]= new X509CertImpl((org.apache.harmony.security.x509.Certificate)it.next());
        }

        List sigInfos = signedData.getSignerInfos();
        SignerInfo sigInfo;
        if (!sigInfos.isEmpty()) {
View Full Code Here

        String sigProvider = (param.getSigProvider() != null) ? param
                .getSigProvider() : provider;

        if (selfSigned) {
            // generate the certificate
            X509CertImpl x509cert = genX509CertImpl(sigAlgName, version,
                    serialNr, subjectDN, subjectDN, validity, keyPair
                            .getPublic(), privateKey, sigProvider,
                    param.isCA());

            // put the key pair with the newly created cert into the keystore
            keyStore.setKeyEntry(param.getAlias(), privateKey, param
                    .getKeyPass(), new X509Certificate[] { x509cert });

        } else {
            // generate the certificate
            X509CertImpl x509cert = genX509CertImpl(sigAlgName, version,
                    serialNr, subjectDN, issuerDN, validity, keyPair
                            .getPublic(), issuerPrivateKey,
                    sigProvider, param.isCA());

            // construct the certificate chain
View Full Code Here

                .valueOf(randomInt);

        // generate a new certificate
        String sigProvider = (param.getSigProvider() != null) ? param
                .getSigProvider() : param.getProvider();
        X509CertImpl x509cert = genX509CertImpl(sigAlgName, version, serialNr,
                distinguishedName, distinguishedName, validity, existing
                        .getPublicKey(), privateKey, sigProvider, param.isCA());

        if (param.isVerbose()) {
            System.out.println("New self-signed certificate: ");
            System.out.println("Version: v" + x509cert.getVersion());
            System.out.println("Owner: " + x509cert.getSubjectX500Principal());
            System.out.println("Issuer: " + x509cert.getIssuerX500Principal());
            System.out.println("Public key: " + x509cert.getPublicKey());
            System.out
                    .println("Signature algorithm: OID."
                            + x509cert.getSigAlgOID() + ", "
                            + x509cert.getSigAlgName());
            System.out
                    .println("Serial number: "
                            // String.format("%x", x509cert.getSerialNumber()));
                            // TODO: print with String.format(..) when the
                            // method is
                            // implemented, and remove Integer.toHexString(..).
                            + Integer.toHexString(x509cert.getSerialNumber()
                                    .intValue()));

            System.out.println("Validity: \n    From: "
                    + x509cert.getNotBefore() + "\n      To: "
                    + x509cert.getNotAfter());
        }

        // put the new certificate into the entry, associated with the alias
        keyStore.setKeyEntry(alias, privateKey, param.getKeyPass(),
                new X509Certificate[] { x509cert });
View Full Code Here

        // actual X.509 certificate generation
        org.apache.harmony.security.x509.Certificate cert;
        cert = new org.apache.harmony.security.x509.Certificate(tbsCertificate,
                algId, signatureValue);
        return new X509CertImpl(cert);
    }
View Full Code Here

            return null;
        }
        X509Certificate[] certs = new X509Certificate[encCerts.size()];
        int i = 0;
        for (Iterator it = encCerts.iterator(); it.hasNext();) {
            certs[i++]= new X509CertImpl((org.apache.harmony.security.x509.Certificate)it.next());
        }

        List sigInfos = signedData.getSignerInfos();
        SignerInfo sigInfo;
        if (!sigInfos.isEmpty()) {
View Full Code Here

        String sigProvider = (param.getSigProvider() != null) ? param
                .getSigProvider() : provider;

        if (selfSigned) {
            // generate the certificate
            X509CertImpl x509cert = genX509CertImpl(sigAlgName, version,
                    serialNr, subjectDN, subjectDN, validity, keyPair
                            .getPublic(), privateKey, sigProvider,
                    param.isCA());

            // put the key pair with the newly created cert into the keystore
            keyStore.setKeyEntry(param.getAlias(), privateKey, param
                    .getKeyPass(), new X509Certificate[] { x509cert });

        } else {
            // generate the certificate
            X509CertImpl x509cert = genX509CertImpl(sigAlgName, version,
                    serialNr, subjectDN, issuerDN, validity, keyPair
                            .getPublic(), issuerPrivateKey,
                    sigProvider, param.isCA());

            // construct the certificate chain
View Full Code Here

                .valueOf(randomInt);

        // generate a new certificate
        String sigProvider = (param.getSigProvider() != null) ? param
                .getSigProvider() : param.getProvider();
        X509CertImpl x509cert = genX509CertImpl(sigAlgName, version, serialNr,
                distinguishedName, distinguishedName, validity, existing
                        .getPublicKey(), privateKey, sigProvider, param.isCA());

        if (param.isVerbose()) {
            System.out.println("New self-signed certificate: ");
            System.out.println("Version: v" + x509cert.getVersion());
            System.out.println("Owner: " + x509cert.getSubjectX500Principal());
            System.out.println("Issuer: " + x509cert.getIssuerX500Principal());
            System.out.println("Public key: " + x509cert.getPublicKey());
            System.out
                    .println("Signature algorithm: OID."
                            + x509cert.getSigAlgOID() + ", "
                            + x509cert.getSigAlgName());
            System.out
                    .println("Serial number: "
                            // String.format("%x", x509cert.getSerialNumber()));
                            // TODO: print with String.format(..) when the
                            // method is
                            // implemented, and remove Integer.toHexString(..).
                            + Integer.toHexString(x509cert.getSerialNumber()
                                    .intValue()));

            System.out.println("Validity: \n    From: "
                    + x509cert.getNotBefore() + "\n      To: "
                    + x509cert.getNotAfter());
        }

        // put the new certificate into the entry, associated with the alias
        keyStore.setKeyEntry(alias, privateKey, param.getKeyPass(),
                new X509Certificate[] { x509cert });
View Full Code Here

TOP

Related Classes of org.apache.harmony.security.provider.cert.X509CertImpl

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.