Here you can find the source of getKeyStore(String keyStorePath, String password)
public static KeyStore getKeyStore(String keyStorePath, String password) throws Exception
//package com.java2s; import java.io.FileInputStream; import java.security.KeyStore; public class Main { public static final String KEY_STORE = "JKS"; public static KeyStore getKeyStore(String keyStorePath, String password) throws Exception { FileInputStream is = new FileInputStream(keyStorePath); KeyStore ks = KeyStore.getInstance(KEY_STORE); ks.load(is, password.toCharArray()); is.close();/*from ww w.j a v a 2 s .c om*/ return ks; } }