public static Optional<JksOptions> buildJksKeyStoreOptions(
      final Map<String, String> props,
      final Optional<String> alias
  ) {
    final String location = getKeyStoreLocation(props);
    final String keyStorePassword = getKeyStorePassword(props);
    final String keyPassword = getKeyPassword(props);

    if (!Strings.isNullOrEmpty(location)) {
      final JksOptions jksOptions;

      if (alias.isPresent() && !alias.get().isEmpty()) {
        jksOptions = buildJksOptions(
            loadJksKeyStore(location, keyStorePassword, keyPassword, alias.get()),
            keyStorePassword
        );
      } else {
        jksOptions = buildJksOptions(location, keyStorePassword);
      }

      return Optional.of(jksOptions);
    }

    return Optional.empty();
  }
@Test
  public void shouldBuildKeyStoreJksOptionsWithPathAndPassword() {
    // When
    final Optional<JksOptions> jksOptions = VertxSslOptionsFactory.buildJksKeyStoreOptions(
        ImmutableMap.of(
            SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG,
            "path",
            SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG,
            "password"
        ),
        Optional.empty()
    );

    // Then
    assertThat(jksOptions.get().getPath(), is("path"));
    assertThat(jksOptions.get().getPassword(), is("password"));
  }