Package io.vertx.core.net

Examples of io.vertx.core.net.JKSOptions


    assertEquals(Buffer.buffer(value), options.getValue());
  }

  @Test
  public void testCopyJKSOptions() throws Exception {
    JKSOptions options = new JKSOptions();
    String password = TestUtils.randomAlphaString(100);
    String path = TestUtils.randomAlphaString(100);
    Buffer value = Buffer.buffer(TestUtils.randomAlphaString(100));
    options.setPassword(password);
    options.setPath(path);
    options.setValue(value);
    options = new JKSOptions(options);
    assertEquals(password, options.getPassword());
    assertEquals(path, options.getPath());
    assertEquals(value, options.getValue());
  }
View Full Code Here


    testKeyStore(getServerCertOptions(KS.JKS));
  }

  @Test
  public void testJKSValue() throws Exception {
    JKSOptions options = (JKSOptions) getServerCertOptions(KS.JKS);
    Buffer store = vertx.fileSystem().readFileSync(options.getPath());
    options.setPath(null).setValue(store);
    testKeyStore(options);
  }
View Full Code Here

    return this;
  }

  @Override
  public JKSOptions clone() {
    return new JKSOptions(this);
  }
View Full Code Here

  // Dummy password for encrypting pem based stores in memory
  private static final String DUMMY_PASSWORD = "dummy";

  public static KeyStoreHelper create(VertxInternal vertx, KeyStoreOptions options) {
    if (options instanceof JKSOptions) {
      JKSOptions jks = (JKSOptions) options;
      Callable<Buffer> value;
      if (jks.getPath() != null) {
        value = () -> vertx.fileSystem().readFileSync(vertx.resolveFile(jks.getPath()).getAbsolutePath());
      } else if (jks.getValue() != null) {
        value = () -> jks.getValue();
      } else {
        return null;
      }
      return new JKSOrPKCS12("JKS", jks.getPassword(), value);
    } else if (options instanceof PKCS12Options) {
      PKCS12Options pkcs12 = (PKCS12Options) options;
      Callable<Buffer> value;
      if (pkcs12.getPath() != null) {
        value = () -> vertx.fileSystem().readFileSync(vertx.resolveFile(pkcs12.getPath()).getAbsolutePath());
View Full Code Here

TOP

Related Classes of io.vertx.core.net.JKSOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.