Java 类io.vertx.core.net.KeyCertOptions 实例源码

项目:hono    文件:AbstractServiceBase.java   
/**
 * Copies TLS key & certificate configuration to a given set of server options.
 * <p>
 * If <em>config</em> contains key &amp; certificate configuration it is added to
 * the given server options and the <em>ssl</em> flag is set to {@code true}.
 * 
 * @param serverOptions The options to add configuration to.
 */
protected final void addTlsKeyCertOptions(final NetServerOptions serverOptions) {

    KeyCertOptions keyCertOptions = getConfig().getKeyCertOptions();

    if (keyCertOptions != null) {
        serverOptions.setSsl(true).setKeyCertOptions(keyCertOptions);
    }
}
项目:hono    文件:ConnectionFactoryImpl.java   
private void addTlsKeyCertOptions(final ProtonClientOptions clientOptions) {

        if (clientOptions.getKeyCertOptions() == null) {
            KeyCertOptions keyCertOptions = config.getKeyCertOptions();
            if (keyCertOptions != null) {
                clientOptions.setSsl(true).setKeyCertOptions(keyCertOptions);
                clientOptions.addEnabledSaslMechanism(ProtonSaslExternalImpl.MECH_NAME);
            }
        }
    }
项目:hono    文件:AbstractConfigTest.java   
/**
 * Test a valid PFX configuration.
 */
@Test
public void testPfxConfig() {
    final TestConfig cfg = new TestConfig();
    cfg.setKeyStorePath(PREFIX_KEY_PATH + "honoKeyStore.p12");
    cfg.setKeyStorePassword("honokeys");

    final KeyCertOptions options = cfg.getKeyCertOptions();

    Assert.assertNotNull(options);
    Assert.assertThat(options, instanceOf(PfxOptions.class));
}
项目:hono    文件:AbstractConfigTest.java   
/**
 * Test a valid PEM configuration.
 */
@Test
public void testPemConfig() {
    final TestConfig cfg = new TestConfig();
    cfg.setKeyPath(PREFIX_KEY_PATH + "hono-messaging-key.pem");
    cfg.setCertPath(PREFIX_KEY_PATH + "hono-messaging-cert.pem");

    final KeyCertOptions options = cfg.getKeyCertOptions();

    Assert.assertNotNull(options);
    Assert.assertThat(options, instanceOf(PemKeyCertOptions.class));
}
项目:hono    文件:AbstractConfigTest.java   
/**
 * Specify key and cert, but override type PKCS12.
 */
@Test
public void testInvalidConfig1() {
    final TestConfig cfg = new TestConfig();
    cfg.setKeyPath(PREFIX_KEY_PATH + "hono-messaging-key.pem");
    cfg.setCertPath(PREFIX_KEY_PATH + "hono-messaging-cert.pem");
    cfg.setKeyFormat(FileFormat.PKCS12);

    final KeyCertOptions options = cfg.getKeyCertOptions();

    Assert.assertNull(options);
}
项目:hono    文件:AbstractConfigTest.java   
/**
 * Specify a keystore, but override type PEM.
 */
@Test
public void testInvalidConfig2() {
    final TestConfig cfg = new TestConfig();
    cfg.setKeyStorePath(PREFIX_KEY_PATH + "honoKeyStore.p12");
    cfg.setKeyStorePassword("honokeys");

    cfg.setKeyFormat(FileFormat.PEM);

    final KeyCertOptions options = cfg.getKeyCertOptions();

    Assert.assertNull(options);
}
项目:vertx-acme4j    文件:DynamicCertOptions.java   
@Override
public KeyCertOptions clone() {
    return this; // I ask for forgiveness
}
项目:reactive-pg-client    文件:PgConnectOptions.java   
@Override
public PgConnectOptions setKeyCertOptions(KeyCertOptions options) {
  return (PgConnectOptions)super.setKeyCertOptions(options);
}
项目:chili-core    文件:TrustAndKeyProvider.java   
public TrustAndKeyProvider(TrustOptions trust, KeyCertOptions keyCert) {
    this.trust = trust;
    this.keyCert = keyCert;
}
项目:chili-core    文件:TrustAndKeyProvider.java   
/**
 * @return key and cert options for the wrapped provider implementation.
 */
public KeyCertOptions keyCertOptions() {
    return keyCert;
}
项目:vertx-mqtt    文件:MqttServerOptions.java   
@Override
public MqttServerOptions setKeyCertOptions(KeyCertOptions options) {
  super.setKeyCertOptions(options);
  return this;
}
项目:vertx-mqtt    文件:MqttClientOptions.java   
@Override
public MqttClientOptions setKeyCertOptions(KeyCertOptions options) {
   super.setKeyCertOptions(options);
   return this;
}
项目:vertx-shell    文件:SSHTermOptions.java   
/**
 * @return the key pair options
 */
@GenIgnore
public KeyCertOptions getKeyPairOptions() {
  return keyPairOptions;
}
项目:vertx-amqp-bridge    文件:AmqpBridgeOptions.java   
@Override
public AmqpBridgeOptions setKeyCertOptions(KeyCertOptions options) {
  super.setKeyCertOptions(options);
  return this;
}
项目:vertx-proton    文件:ProtonServerOptions.java   
@Override
public ProtonServerOptions setKeyCertOptions(KeyCertOptions options) {
  super.setKeyCertOptions(options);
  return this;
}
项目:vertx-proton    文件:ProtonClientOptions.java   
@Override
public ProtonClientOptions setKeyCertOptions(KeyCertOptions options) {
  super.setKeyCertOptions(options);
  return this;
}
项目:vertx-web    文件:WebClientOptions.java   
@Override
public WebClientOptions setKeyCertOptions(KeyCertOptions options) {
  return (WebClientOptions) super.setKeyCertOptions(options);
}