Class KeyStoreOptions

  • All Implemented Interfaces:
    KeyCertOptions, TrustOptions

    public class KeyStoreOptions
    extends KeyStoreOptionsBase
    Key or trust store options configuring private key and/or certificates based on KeyStore.
    • when used as a key store, it should point to a store containing a private key and its certificate.
    • when used as a trust store, it should point to a store containing a list of trusted certificates.

    The store can either be loaded by Vert.x from the filesystem:

     HttpServerOptions options = HttpServerOptions.httpServerOptions();
     options.setKeyCertOptions(new KeyStoreOptions().setType("JKS").setPath("/mykeystore.jks").setPassword("foo"));
     
    Or directly provided as a buffer:
     Buffer store = vertx.fileSystem().readFileBlocking("/mykeystore.jks");
     options.setKeyCertOptions(new KeyStoreOptions().setType("JKS").setValue(store).setPassword("foo"));
     

    You can also use specific subclasses JksOptions or PfxOptions that will set the setType(java.lang.String) for you:

     HttpServerOptions options = HttpServerOptions.httpServerOptions();
     options.setKeyCertOptions(new JksOptions().setPath("/mykeystore.jks").setPassword("foo"));
     
    Author:
    Julien Viet, Tim Fox