io.vertx.core.net

## Class KeyStoreOptions

- java.lang.Object
- - io.vertx.core.net.KeyStoreOptionsBase
  - - io.vertx.core.net.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

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `KeyStoreOptions` | `copy()`
    `String` | `getProvider()`
    `String` | `getType()`
    `KeyStoreOptions` | `setAlias(String alias)` Set the alias for a server certificate when the keystore has more than one.
    `KeyStoreOptions` | `setAliasPassword(String aliasPassword)` Set the password for the server certificate designated by `KeyStoreOptionsBase.getAlias()`.
    `KeyStoreOptions` | `setPassword(String password)` Set the password for the key store
    `KeyStoreOptions` | `setPath(String path)` Set the path to the key store
    `KeyStoreOptions` | `setProvider(String provider)` Set the store provider.
    `KeyStoreOptions` | `setType(String type)` Set the store type.
    `KeyStoreOptions` | `setValue(Buffer value)` Set the key store as a buffer
    `JsonObject` | `toJson()` Convert to JSON

    - ### Methods inherited from class io.vertx.core.net.KeyStoreOptionsBase

      `getAlias, getAliasPassword, getKeyManagerFactory, getPassword, getPath, getTrustManagerFactory, getValue, keyManagerMapper, loadKeyStore, trustManagerMapper`

    - ### 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

      `wrap, wrap`

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

      `wrap, wrap`

- - ### Constructor Detail

    - #### KeyStoreOptions

          public KeyStoreOptions()

      Default constructor

    - #### KeyStoreOptions

          public KeyStoreOptions(KeyStoreOptions other)

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

    - #### KeyStoreOptions

          public KeyStoreOptions(JsonObject json)

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

  - ### Method Detail

    - #### getProvider

          public String getProvider()

      Overrides:
        `getProvider` in class `KeyStoreOptionsBase`
      Returns:
        the store provider

    - #### setProvider

          public KeyStoreOptions setProvider(String provider)

      Set the store provider.
      Overrides:
        `setProvider` in class `KeyStoreOptionsBase`
      Parameters:
        `provider` - the type
      Returns:
        a reference to this, so the API can be used fluently

    - #### getType

          public String getType()

      Overrides:
        `getType` in class `KeyStoreOptionsBase`
      Returns:
        the store type

    - #### setType

          public KeyStoreOptions setType(String type)

      Set the store type.
      Overrides:
        `setType` in class `KeyStoreOptionsBase`
      Parameters:
        `type` - the type
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPassword

          public KeyStoreOptions setPassword(String password)

      Description copied from class: `KeyStoreOptionsBase`
      Set the password for the key store
      Overrides:
        `setPassword` in class `KeyStoreOptionsBase`
      Parameters:
        `password` - the password
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPath

          public KeyStoreOptions setPath(String path)

      Description copied from class: `KeyStoreOptionsBase`
      Set the path to the key store
      Overrides:
        `setPath` in class `KeyStoreOptionsBase`
      Parameters:
        `path` - the path
      Returns:
        a reference to this, so the API can be used fluently

    - #### setValue

          public KeyStoreOptions setValue(Buffer value)

      Description copied from class: `KeyStoreOptionsBase`
      Set the key store as a buffer
      Overrides:
        `setValue` in class `KeyStoreOptionsBase`
      Parameters:
        `value` - the key store as a buffer
      Returns:
        a reference to this, so the API can be used fluently

    - #### setAlias

          public KeyStoreOptions setAlias(String alias)

      Description copied from class: `KeyStoreOptionsBase`
      Set the alias for a server certificate when the keystore has more than one.
      Overrides:
        `setAlias` in class `KeyStoreOptionsBase`
      Returns:
        a reference to this, so the API can be used fluently

    - #### setAliasPassword

          public KeyStoreOptions setAliasPassword(String aliasPassword)

      Description copied from class: `KeyStoreOptionsBase`
      Set the password for the server certificate designated by `KeyStoreOptionsBase.getAlias()`.
      Overrides:
        `setAliasPassword` in class `KeyStoreOptionsBase`
      Returns:
        a reference to this, so the API can be used fluently

    - #### copy

          public KeyStoreOptions copy()

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

    - #### toJson

          public JsonObject toJson()

      Convert to JSON
      Returns:
        the JSON

Copyright © 2022 Eclipse. All rights reserved.