public static KeyStore loadKeyStore(String type,File file,char[] password) throws Exception {
  KeyStore keyStore=KeyStore.getInstance(type);
  try (FileInputStream fis=new FileInputStream(file)){
    keyStore.load(fis,password);
  }
   return keyStore;
}

public static KeyStore loadKeyStore ( String type , File file , char [ ] password ) throws Exception { KeyStore keyStore = KeyStore . getInstance ( type ) ; try ( FileInputStream fis = new FileInputStream ( file ) ) { keyStore . load ( fis , password ) ; } return keyStore ; }
loads a key store from a file .
