code: public static PrivateKey loadPrivateKeyFromKeyStore(String location,String alias,String storeType,String storePass,String keyPass){
          try {			
          	storeType = null == storeType ? KeyStore.getDefaultType() : storeType;
          	keyPass = keyPass == null ? storePass : keyPass;
          	KeyStore keyStore = KeyStore.getInstance(storeType);
          	InputStream is = new FileInputStream(location);
          	keyStore.load(is, storePass.toCharArray());
          	// 由密钥库获取密钥的两种方式
          	return (PrivateKey) keyStore.getKey(alias, keyPass.toCharArray());
  		} catch (Exception e) {
  			throw new RuntimeException(e);
  		}
      }
docs: 从KeyStore获取私钥
  @param location
  @param alias
  @param storeType
  @param storePass
  @param keyPass
  @return