private static KeyStore loadKeyStore(final InputStream inputStream, final String storePasswd, final String keyStoreType) {
        try {
            LOGGER.debug("Loading keystore with type {}", keyStoreType);
            val ks = KeyStore.getInstance(keyStoreType);
            ks.load(inputStream, storePasswd == null ? null : storePasswd.toCharArray());
            LOGGER.debug("Loaded keystore with type {} with size {}", keyStoreType, ks.size());
            return ks;
        } catch (final Exception e) {
            throw new SAMLException("Error loading keystore", e);
        }
    }
Class responsible for loading a private key from a JKS keystore and returning
the corresponding {@link Credential} opensaml object.

@author Misagh Moayyed
@since 1.8.0
pac4j-saml/src/main/java/org/pac4j/saml/crypto/KeyStoreCredentialProvider.java