code: public static PrivateKey getPrivateKey(KeyStore keyStore, String alias, String keyPass)
        throws GeneralSecurityException {
      return (PrivateKey) keyStore.getKey(alias, keyPass.toCharArray());
    }
docs: Returns the private key from the key store.
  
  @param keyStore key store
  @param alias alias under which the key is stored
  @param keyPass password protecting the key
  @return private key