json.put("pemKeyCertOptions", obj.getPemKeyCertOptions().toJson());
json.put("pemKeyCertOptions", obj.getPemKeyCertOptions().toJson());
assertEquals(Collections.singletonList(certPath1), options.getCertPaths()); assertEquals(Collections.singletonList(certValue1), options.getCertValues()); options = new PemKeyCertOptions(options.toJson()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(Arrays.asList(certPath1, certPath2), options.getCertPaths()); assertEquals(Arrays.asList(certValue1, certValue2), options.getCertValues()); options = new PemKeyCertOptions(options.toJson()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue());
json.put("pemKeyCertOptions", obj.getPemKeyCertOptions().toJson());
json.put("pemKeyCertOptions", obj.getPemKeyCertOptions().toJson());
assertEquals(Collections.singletonList(certPath1), options.getCertPaths()); assertEquals(Collections.singletonList(certValue1), options.getCertValues()); options = new PemKeyCertOptions(options.toJson()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(Arrays.asList(certPath1, certPath2), options.getCertPaths()); assertEquals(Arrays.asList(certValue1, certValue2), options.getCertValues()); options = new PemKeyCertOptions(options.toJson()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue());
public static java.util.Map<String, Object> keyCertOptions(io.vertx.core.net.SelfSignedCertificate j_receiver) { return j_receiver.keyCertOptions() != null ? io.vertx.core.impl.ConversionHelper.fromJsonObject(j_receiver.keyCertOptions().toJson()) : null; } public static java.util.Map<String, Object> trustOptions(io.vertx.core.net.SelfSignedCertificate j_receiver) {
public JsonObject getConfiguration() { JsonObject config = new JsonObject(); config.put("host", getHost()); config.put("port", getPort()); config.put("ssl", true); PemKeyCertOptions options = new PemKeyCertOptions() .addCertPath("target/vault/config/ssl/client-cert.pem") .addKeyPath("target/vault/config/ssl/client-privatekey.pem"); config.put("pemKeyCertOptions", options.toJson()); JksOptions jks = new JksOptions() .setPath("target/vault/config/ssl/truststore.jks"); config.put("trustStoreOptions", jks.toJson()); return config; }
public JsonObject getConfiguration() { JsonObject config = new JsonObject(); config.put("host", getHost()); config.put("port", getPort()); config.put("ssl", true); PemKeyCertOptions options = new PemKeyCertOptions() .addCertPath("target/vault/config/ssl/client-cert.pem") .addKeyPath("target/vault/config/ssl/client-privatekey.pem"); config.put("pemKeyCertOptions", options.toJson()); JksOptions jks = new JksOptions() .setPath("target/vault/config/ssl/truststore.jks"); config.put("trustStoreOptions", jks.toJson()); return config; }
json.put("pemKeyCertOptions", obj.getPemKeyCertOptions().toJson());
@Override protected JsonObject getRetrieverConfiguration() { JsonObject config = new JsonObject(); config.put("host", process.getHost()); config.put("port", process.getPort()); config.put("ssl", true); PemKeyCertOptions options = new PemKeyCertOptions() .addCertPath("target/vault/config/ssl/client-cert.pem") .addKeyPath("target/vault/config/ssl/client-privatekey.pem"); config.put("pemKeyCertOptions", options.toJson()); PemTrustOptions trust = new PemTrustOptions() .addCertPath("target/vault/config/ssl/cert.pem"); config.put("pemTrustStoreOptions", trust.toJson()); JksOptions jks = new JksOptions() .setPath("target/vault/config/ssl/truststore.jks"); config.put("trustStoreOptions", jks.toJson()); config.put("auth-backend", "cert"); return config; }
@Override protected JsonObject getRetrieverConfiguration() { JsonObject config = new JsonObject(); config.put("host", process.getHost()); config.put("port", process.getPort()); config.put("ssl", true); PemKeyCertOptions options = new PemKeyCertOptions() .addCertPath("target/vault/config/ssl/client-cert.pem") .addKeyPath("target/vault/config/ssl/client-privatekey.pem"); config.put("pemKeyCertOptions", options.toJson()); PemTrustOptions trust = new PemTrustOptions() .addCertPath("target/vault/config/ssl/cert.pem"); config.put("pemTrustStoreOptions", trust.toJson()); JksOptions jks = new JksOptions() .setPath("target/vault/config/ssl/truststore.jks"); config.put("trustStoreOptions", jks.toJson()); config.put("auth-backend", "cert"); return config; }
/** * Tests authentication with the cert auth backend using PEM file */ @Test public void testLoginByCert_usingPemConfig(TestContext tc) throws VaultException { JsonObject config = new JsonObject(); config.put("host", process.getHost()); config.put("port", process.getPort()); config.put("ssl", true); PemKeyCertOptions options = new PemKeyCertOptions() .addCertPath("target/vault/config/ssl/client-cert.pem") .addKeyPath("target/vault/config/ssl/client-privatekey.pem"); config.put("pemKeyCertOptions", options.toJson()); PemTrustOptions trust = new PemTrustOptions() .addCertPath("target/vault/config/ssl/cert.pem"); config.put("pemTrustStoreOptions", trust.toJson()); JksOptions jks = new JksOptions() .setPath("target/vault/config/ssl/truststore.jks"); config.put("trustStoreOptions", jks.toJson()); client = new SlimVaultClient(vertx, config); checkWeCanLoginAndAccessRestrictedSecrets(tc); }
/** * Tests authentication with the cert auth backend using PEM file */ @Test public void testLoginByCert_usingPemConfig(TestContext tc) throws VaultException { JsonObject config = new JsonObject(); config.put("host", process.getHost()); config.put("port", process.getPort()); config.put("ssl", true); PemKeyCertOptions options = new PemKeyCertOptions() .addCertPath("target/vault/config/ssl/client-cert.pem") .addKeyPath("target/vault/config/ssl/client-privatekey.pem"); config.put("pemKeyCertOptions", options.toJson()); PemTrustOptions trust = new PemTrustOptions() .addCertPath("target/vault/config/ssl/cert.pem"); config.put("pemTrustStoreOptions", trust.toJson()); JksOptions jks = new JksOptions() .setPath("target/vault/config/ssl/truststore.jks"); config.put("trustStoreOptions", jks.toJson()); client = new SlimVaultClient(vertx, config); checkWeCanLoginAndAccessRestrictedSecrets(tc); }