io.vertx.core.net

## Class JksOptions

- java.lang.Object
- - io.vertx.core.net.JksOptions

- All Implemented Interfaces:
    KeyCertOptions, TrustOptions

      public class JksOptions
      extends Object
      implements KeyCertOptions, TrustOptions

  Key or trust store options configuring private key and/or certificates based on Java Keystore files.

  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.setKeyStore(new JKSOptions().setPath("/mykeystore.jks").setPassword("foo"));

  Or directly provided as a buffer:

       Buffer store = vertx.fileSystem().readFileBlocking("/mykeystore.jks");
       options.setKeyStore(new JKSOptions().setValue(store).setPassword("foo"));

  Author:
    Julien Viet, Tim Fox

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JksOptions()` Default constructor
    `JksOptions(JksOptions other)` Copy constructor
    `JksOptions(JsonObject json)` Create options from JSON

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `JksOptions` | `copy()`
    `String` | `getPassword()`
    `String` | `getPath()` Get the path to the ksy store
    `Buffer` | `getValue()` Get the key store as a buffer
    `JksOptions` | `setPassword(String password)` Set the password for the key store
    `JksOptions` | `setPath(String path)` Set the path to the key store
    `JksOptions` | `setValue(Buffer value)` Set the key store as a buffer
    `JsonObject` | `toJson()` Convert to JSON

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface io.vertx.core.net.KeyCertOptions

      `getKeyManagerFactory, keyManagerMapper`

    - ### Methods inherited from interface io.vertx.core.net.TrustOptions

      `getTrustManagerFactory, trustManagerMapper`

- - ### Constructor Detail

    - #### JksOptions

          public JksOptions()

      Default constructor

    - #### JksOptions

          public JksOptions(JksOptions other)

      Copy constructor
      Parameters:
        `other` - the options to copy

    - #### JksOptions

          public JksOptions(JsonObject json)

      Create options from JSON
      Parameters:
        `json` - the JSON

  - ### Method Detail

    - #### toJson

          public JsonObject toJson()

      Convert to JSON
      Specified by:
        `toJson` in interface `TrustOptions`
      Returns:
        the JSON

    - #### getPassword

          public String getPassword()

      Returns:
        the password for the key store

    - #### setPassword

          public JksOptions setPassword(String password)

      Set the password for the key store
      Parameters:
        `password` - the password
      Returns:
        a reference to this, so the API can be used fluently

    - #### getPath

          public String getPath()

      Get the path to the ksy store
      Returns:
        the path

    - #### setPath

          public JksOptions setPath(String path)

      Set the path to the key store
      Parameters:
        `path` - the path
      Returns:
        a reference to this, so the API can be used fluently

    - #### getValue

          public Buffer getValue()

      Get the key store as a buffer
      Returns:
        the key store as a buffer

    - #### setValue

          public JksOptions setValue(Buffer value)

      Set the key store as a buffer
      Parameters:
        `value` - the key store as a buffer
      Returns:
        a reference to this, so the API can be used fluently

    - #### copy

          public JksOptions copy()

      Specified by:
        `copy` in interface `KeyCertOptions`
      Specified by:
        `copy` in interface `TrustOptions`
      Returns:
        a copy of these options

Copyright © 2020 Eclipse. All rights reserved.