Here you can find the source of getKeyStore(File keystore)
public static KeyStore getKeyStore(File keystore) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, UnsupportedCallbackException
//package com.java2s; //License from project: Apache License import java.io.File; 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; import javax.security.auth.callback.UnsupportedCallbackException; public class Main { public static KeyStore getKeyStore(File keystore) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, UnsupportedCallbackException { KeyStore keystore_client = KeyStore.getInstance("JKS"); keystore_client.load(keystore != null ? new FileInputStream(keystore) : null, null); return keystore_client; }//from w w w. j av a 2 s. com }