Code example for KeyStore

Methods: load

0
                    }); 
            String keyStorePwd = null;
            if (keyStoreName == null || keyStoreName.equalsIgnoreCase("NONE")
                    || keyStoreName.length() == 0) {
                try { 
                    keyStore.load(null, null);
                } catch (IOException e) {
                    throw new KeyStoreException(e);
                } catch (CertificateException e) {
                    throw new KeyStoreException(e);
                } catch (NoSuchAlgorithmException e) {
                    throw new KeyStoreException(e);
                } 
            } else { 
                keyStorePwd = AccessController
                        .doPrivileged(new java.security.PrivilegedAction<String>() {
                            public String run() {
                                return System 
                                        .getProperty("javax.net.ssl.trustStorePassword");
                            } 
                        }); 
                char[] pwd;
                if (keyStorePwd == null) {
                    pwd = new char[0];
                } else { 
                    pwd = keyStorePwd.toCharArray();
                } 
                try { 
                    keyStore.load(new BufferedInputStream(new FileInputStream(keyStoreName)), pwd);
                } catch (FileNotFoundException e) {
                    throw new KeyStoreException(e);
                } catch (IOException e) {
                    throw new KeyStoreException(e);
                } catch (CertificateException e) {