Example usage for io.vertx.core.net PfxOptions PfxOptions

List of usage examples for io.vertx.core.net PfxOptions PfxOptions

Introduction

In this page you can find the example usage for io.vertx.core.net PfxOptions PfxOptions.

Prototype

public PfxOptions() 

Source Link

Document

Default constructor

Usage

From source file:examples.NetExamples.java

License:Open Source License

public void example19(Vertx vertx) {
    NetServerOptions options = new NetServerOptions().setSsl(true).setPfxKeyCertOptions(new PfxOptions()
            .setPath("/path/to/your/server-keystore.pfx").setPassword("password-of-your-keystore"));
    NetServer server = vertx.createNetServer(options);
}

From source file:examples.NetExamples.java

License:Open Source License

public void example20(Vertx vertx) {
    Buffer myKeyStoreAsABuffer = vertx.fileSystem().readFileBlocking("/path/to/your/server-keystore.pfx");
    PfxOptions pfxOptions = new PfxOptions().setValue(myKeyStoreAsABuffer)
            .setPassword("password-of-your-keystore");
    NetServerOptions options = new NetServerOptions().setSsl(true).setPfxKeyCertOptions(pfxOptions);
    NetServer server = vertx.createNetServer(options);
}

From source file:examples.NetExamples.java

License:Open Source License

public void example25(Vertx vertx) {
    NetServerOptions options = new NetServerOptions().setSsl(true).setClientAuth(ClientAuth.REQUIRED)
            .setPfxTrustOptions(new PfxOptions().setPath("/path/to/your/truststore.pfx")
                    .setPassword("password-of-your-truststore"));
    NetServer server = vertx.createNetServer(options);
}

From source file:examples.NetExamples.java

License:Open Source License

public void example26(Vertx vertx) {
    Buffer myTrustStoreAsABuffer = vertx.fileSystem().readFileBlocking("/path/to/your/truststore.pfx");
    NetServerOptions options = new NetServerOptions().setSsl(true).setClientAuth(ClientAuth.REQUIRED)
            .setPfxTrustOptions(new PfxOptions().setValue(myTrustStoreAsABuffer)
                    .setPassword("password-of-your-truststore"));
    NetServer server = vertx.createNetServer(options);
}

From source file:examples.NetExamples.java

License:Open Source License

public void example32(Vertx vertx) {
    NetClientOptions options = new NetClientOptions().setSsl(true).setPfxTrustOptions(new PfxOptions()
            .setPath("/path/to/your/truststore.pfx").setPassword("password-of-your-truststore"));
    NetClient client = vertx.createNetClient(options);
}

From source file:examples.NetExamples.java

License:Open Source License

public void example33(Vertx vertx) {
    Buffer myTrustStoreAsABuffer = vertx.fileSystem().readFileBlocking("/path/to/your/truststore.pfx");
    NetClientOptions options = new NetClientOptions().setSsl(true).setPfxTrustOptions(
            new PfxOptions().setValue(myTrustStoreAsABuffer).setPassword("password-of-your-truststore"));
    NetClient client = vertx.createNetClient(options);
}

From source file:examples.NetExamples.java

License:Open Source License

public void example38(Vertx vertx) {
    NetClientOptions options = new NetClientOptions().setSsl(true).setPfxKeyCertOptions(new PfxOptions()
            .setPath("/path/to/your/client-keystore.pfx").setPassword("password-of-your-keystore"));
    NetClient client = vertx.createNetClient(options);
}

From source file:examples.NetExamples.java

License:Open Source License

public void example39(Vertx vertx) {
    Buffer myKeyStoreAsABuffer = vertx.fileSystem().readFileBlocking("/path/to/your/client-keystore.pfx");
    PfxOptions pfxOptions = new PfxOptions().setValue(myKeyStoreAsABuffer)
            .setPassword("password-of-your-keystore");
    NetClientOptions options = new NetClientOptions().setSsl(true).setPfxKeyCertOptions(pfxOptions);
    NetClient client = vertx.createNetClient(options);
}

From source file:examples.VertxAmqpBridgeExamples.java

License:Apache License

public void example8(Vertx vertx) {
    AmqpBridgeOptions bridgeOptions = new AmqpBridgeOptions();
    bridgeOptions.setSsl(true);/*w  w  w . ja v  a  2 s.c  om*/

    PfxOptions trustOptions = new PfxOptions().setPath("path/to/pkcs12.truststore").setPassword("password");
    bridgeOptions.setPfxTrustOptions(trustOptions);

    AmqpBridge bridge = AmqpBridge.create(vertx, bridgeOptions);
    bridge.start("localhost", 5672, "username", "password", res -> {
        // ..do things with the bridge..
    });
}

From source file:examples.VertxAmqpBridgeExamples.java

License:Apache License

public void example9(Vertx vertx) {
    AmqpBridgeOptions bridgeOptions = new AmqpBridgeOptions();
    bridgeOptions.setSsl(true);//from   w ww  .  j a  v  a2 s.co m

    PfxOptions trustOptions = new PfxOptions().setPath("path/to/pkcs12.truststore").setPassword("password");
    bridgeOptions.setPfxTrustOptions(trustOptions);

    PfxOptions keyCertOptions = new PfxOptions().setPath("path/to/pkcs12.keystore").setPassword("password");
    bridgeOptions.setPfxKeyCertOptions(keyCertOptions);

    AmqpBridge bridge = AmqpBridge.create(vertx, bridgeOptions);
    bridge.start("localhost", 5672, res -> {
        // ..do things with the bridge..
    });
}