Package jp.go.aist.sot.client.security

Examples of jp.go.aist.sot.client.security.PKCS12


    }

    private void importUserCert() {
        Log.debug(CLASS_NAME, "ImportUserCert=>certName=" + filePath);
        PKCS12 pkcs12 = null;

        try {
            if (userCerts == null) {
                userCerts = new KeyStore(FileBaseUtil.getUserKeyStorePath(),
                        storePW);
                userCerts.initialize();
            }
            // check pkcs12 certificate
            pkcs12 = CertificateUtil.getPKCS12Certificate(filePath, importPW);
            if (pkcs12 == null) {
                throw new SignOnException(
                        mh.getMessage("failure_opening_pkcs12"));
            }
            // make alias name.
            X509Certificate cert = (X509Certificate) pkcs12.getCertificate();
            String alias = CertificateNameUtil.makeAliasName(cert);

            // add ks
            userCerts.setKeyEntry(alias, pkcs12.getKey(), importPW,
                    pkcs12.getCertificateChain());
            userCerts.store();
            String cn = CertificateNameUtil.getCommonName(cert);
            SubjectName dn = new SubjectName(alias, cn);

            if (controller == null) {
View Full Code Here


            }
            if (uks == null || uks.size() == 0) {
                throw new SignOnException(mh.getMessage("invalid_passphrase"));
            }
           
            PKCS12 pkcs12 = jp.go.aist.sot.client.security.KeyStore.convertKeyStoreToPKCS12(
                    ks, cn, passphrase.toCharArray());

            mgr.setPKCS12(pkcs12);

            SSLContextFactory factory = new SSLContextFactory(caks, uks,
View Full Code Here

TOP

Related Classes of jp.go.aist.sot.client.security.PKCS12

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.