Here you can find the source of getKeyStore(String filename, String password)
public static KeyStore getKeyStore(String filename, String password) throws KeyStoreException
//package com.java2s; import java.io.*; import java.security.*; public class Main { /**//from ww w. ja va 2s.c o m Get a KeyStore object given the keystore filename and password. */ public static KeyStore getKeyStore(String filename, String password) throws KeyStoreException { KeyStore result = KeyStore.getInstance(KeyStore.getDefaultType()); try { FileInputStream in = new FileInputStream(filename); result.load(in, password.toCharArray()); in.close(); } catch (Exception ex) { System.out.println("Failed to read keystore:"); ex.printStackTrace(); } return result; } /** Get a KeyStore object given the keystore filename and password. */ public static KeyStore getKeyStore(InputStream in, String password) throws KeyStoreException { KeyStore result = KeyStore.getInstance(KeyStore.getDefaultType()); try { result.load(in, password.toCharArray()); } catch (Exception ex) { System.out.println("Failed to read keystore:"); ex.printStackTrace(); } return result; } }