public static KeyManagerFactory buildKeystore(final ClientCertificateProperties properties) {
        return FunctionUtils.doUnchecked(() -> {
            try (val keyInput = properties.getCertificate().getLocation().getInputStream()) {
                val keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
                val keyStore = KeyStore.getInstance("PKCS12");

                keyStore.load(keyInput, properties.getPassphrase().toCharArray());
                keyManagerFactory.init(keyStore, properties.getPassphrase().toCharArray());
                return keyManagerFactory;
            }
        });
    }
Build keystore key manager factory.

@param properties the properties
@return the key manager factory
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/ssl/SSLUtils.java