Here you can find the source of getKeyStore(String keystorePath, String keystorePassword)
private static KeyStore getKeyStore(String keystorePath, String keystorePassword)
//package com.java2s; //License from project: Open Source License import java.io.FileInputStream; import java.io.IOException; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; public class Main { private static KeyStore getKeyStore(String keystorePath, String keystorePassword) { try {//from w w w. ja va2s. com KeyStore keystore = KeyStore.getInstance(KeyStore .getDefaultType()); keystore.load(new FileInputStream(keystorePath), keystorePassword.toCharArray()); return keystore; } catch (KeyStoreException | CertificateException | NoSuchAlgorithmException | IOException e) { e.printStackTrace(); } return null; } }