Class KeyStoreOptions
java.lang.Object
io.vertx.core.net.KeyStoreOptionsBase
io.vertx.core.net.KeyStoreOptions
- All Implemented Interfaces:
KeyCertOptions, TrustOptions
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(String) for you:
HttpServerOptions options = HttpServerOptions.httpServerOptions();
options.setKeyCertOptions(new JksOptions().setPath("/mykeystore.jks").setPassword("foo"));
- Author:
- Julien Viet, Tim Fox
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorKeyStoreOptions(JsonObject json) Create options from JSONKeyStoreOptions(KeyStoreOptions other) Copy constructor -
Method Summary
Modifier and TypeMethodDescriptioncopy()getType()Set the alias for a server certificate when the keystore has more than one.setAliasPassword(String aliasPassword) Set the password for the server certificate designated byKeyStoreOptionsBase.getAlias().setPassword(String password) Set the password for the key storeSet the path to the key storesetProvider(String provider) Set the store provider.Set the store type.Set the key store as a buffertoJson()Convert to JSONMethods inherited from class KeyStoreOptionsBase
equals, getAlias, getAliasPassword, getHelper, getKeyManagerFactory, getPassword, getPath, getTrustManagerFactory, getValue, hashCode, keyManagerFactoryMapper, loadKeyStore, trustManagerMapper
-
Constructor Details
-
KeyStoreOptions
public KeyStoreOptions()Default constructor -
KeyStoreOptions
Copy constructor- Parameters:
other- the options to copy
-
KeyStoreOptions
-
-
Method Details
-
getProvider
- Overrides:
getProviderin classKeyStoreOptionsBase- Returns:
- the store provider
-
setProvider
Set the store provider.- Overrides:
setProviderin classKeyStoreOptionsBase- Parameters:
provider- the type- Returns:
- a reference to this, so the API can be used fluently
-
getType
- Overrides:
getTypein classKeyStoreOptionsBase- Returns:
- the store type
-
setType
Set the store type.- Overrides:
setTypein classKeyStoreOptionsBase- Parameters:
type- the type- Returns:
- a reference to this, so the API can be used fluently
-
setPassword
Description copied from class:KeyStoreOptionsBaseSet the password for the key store- Overrides:
setPasswordin classKeyStoreOptionsBase- Parameters:
password- the password- Returns:
- a reference to this, so the API can be used fluently
-
setPath
Description copied from class:KeyStoreOptionsBaseSet the path to the key store- Overrides:
setPathin classKeyStoreOptionsBase- Parameters:
path- the path- Returns:
- a reference to this, so the API can be used fluently
-
setValue
Description copied from class:KeyStoreOptionsBaseSet the key store as a buffer- Overrides:
setValuein classKeyStoreOptionsBase- Parameters:
value- the key store as a buffer- Returns:
- a reference to this, so the API can be used fluently
-
setAlias
Description copied from class:KeyStoreOptionsBaseSet the alias for a server certificate when the keystore has more than one.- Overrides:
setAliasin classKeyStoreOptionsBase- Returns:
- a reference to this, so the API can be used fluently
-
setAliasPassword
Description copied from class:KeyStoreOptionsBaseSet the password for the server certificate designated byKeyStoreOptionsBase.getAlias().- Overrides:
setAliasPasswordin classKeyStoreOptionsBase- Returns:
- a reference to this, so the API can be used fluently
-
copy
- Specified by:
copyin interfaceKeyCertOptions- Specified by:
copyin interfaceTrustOptions- Specified by:
copyin classKeyStoreOptionsBase- Returns:
- a copy of these options
-
toJson
-