code: public static OpenSslX509KeyManagerFactory newEngineBased(X509Certificate[] certificateChain, String password)
              throws CertificateException, IOException,
                     KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException {
          KeyStore store = new OpenSslKeyStore(certificateChain.clone(), false);
          store.load(null, null);
          OpenSslX509KeyManagerFactory factory = new OpenSslX509KeyManagerFactory();
          factory.init(store, password == null ? null : password.toCharArray());
          return factory;
      }
docs: Create a new initialized {@link OpenSslX509KeyManagerFactory} which loads its {@link PrivateKey} directly from
  an {@code OpenSSL engine} via the
  <a href="https://www.openssl.org/docs/man1.1.0/crypto/ENGINE_load_private_key.html">ENGINE_load_private_key</a>
  function.