public abstract class KeyStoreOptionsBase extends Object implements KeyCertOptions, TrustOptions
KeyStore
based options.Modifier | Constructor and Description |
---|---|
protected |
KeyStoreOptionsBase()
Default constructor
|
protected |
KeyStoreOptionsBase(KeyStoreOptionsBase other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
abstract KeyStoreOptionsBase |
copy() |
String |
getAlias() |
String |
getAliasPassword() |
KeyManagerFactory |
getKeyManagerFactory(Vertx vertx)
Create and return the key manager factory for these options.
|
String |
getPassword() |
String |
getPath()
Get the path to the ksy store
|
protected String |
getProvider() |
TrustManagerFactory |
getTrustManagerFactory(Vertx vertx)
Create and return the trust manager factory for these options.
|
protected String |
getType() |
Buffer |
getValue()
Get the key store as a buffer
|
java.util.function.Function<String,X509KeyManager> |
keyManagerMapper(Vertx vertx)
Returns a function that maps SNI server names to
X509KeyManager instance. |
KeyStore |
loadKeyStore(Vertx vertx)
Load and return a Java keystore.
|
KeyStoreOptionsBase |
setAlias(String alias)
Set the alias for a server certificate when the keystore has more than one.
|
KeyStoreOptionsBase |
setAliasPassword(String aliasPassword)
Set the password for the server certificate designated by
getAlias() . |
KeyStoreOptionsBase |
setPassword(String password)
Set the password for the key store
|
KeyStoreOptionsBase |
setPath(String path)
Set the path to the key store
|
protected KeyStoreOptionsBase |
setProvider(String provider) |
protected KeyStoreOptionsBase |
setType(String type) |
KeyStoreOptionsBase |
setValue(Buffer value)
Set the key store as a buffer
|
java.util.function.Function<String,TrustManager[]> |
trustManagerMapper(Vertx vertx)
Returns a function that maps SNI server names to a
TrustManagerFactory instance. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
wrap, wrap
wrap, wrap
protected KeyStoreOptionsBase()
protected KeyStoreOptionsBase(KeyStoreOptionsBase other)
other
- the options to copyprotected String getType()
protected KeyStoreOptionsBase setType(String type)
protected String getProvider()
protected KeyStoreOptionsBase setProvider(String provider)
public String getPassword()
public KeyStoreOptionsBase setPassword(String password)
password
- the passwordpublic String getPath()
public KeyStoreOptionsBase setPath(String path)
path
- the pathpublic Buffer getValue()
public KeyStoreOptionsBase setValue(Buffer value)
value
- the key store as a bufferpublic String getAlias()
null
public KeyStoreOptionsBase setAlias(String alias)
public String getAliasPassword()
getAlias()
, or null
public KeyStoreOptionsBase setAliasPassword(String aliasPassword)
getAlias()
.public KeyStore loadKeyStore(Vertx vertx) throws Exception
vertx
- the vertx instanceKeyStore
Exception
public KeyManagerFactory getKeyManagerFactory(Vertx vertx) throws Exception
KeyCertOptions
The returned key manager factory should be already initialized and ready to use.
getKeyManagerFactory
in interface KeyCertOptions
vertx
- the vertx instanceException
public java.util.function.Function<String,X509KeyManager> keyManagerMapper(Vertx vertx) throws Exception
KeyCertOptions
X509KeyManager
instance.
The returned X509KeyManager
must satisfies these rules:
X509KeyManager.getPrivateKey(String)
returns the private key for the indicated server name,
the alias
parameter will be null
.X509KeyManager.getCertificateChain(String)
returns the certificate chain for the indicated server name,
the alias
parameter will be null
.
The returned function may return null in which case the default key manager provided by KeyCertOptions.getKeyManagerFactory(Vertx)
will be used.
keyManagerMapper
in interface KeyCertOptions
Exception
public TrustManagerFactory getTrustManagerFactory(Vertx vertx) throws Exception
TrustOptions
The returned trust manager factory should be already initialized and ready to use.
getTrustManagerFactory
in interface TrustOptions
vertx
- the vertx instanceException
public java.util.function.Function<String,TrustManager[]> trustManagerMapper(Vertx vertx) throws Exception
TrustOptions
TrustManagerFactory
instance.
The returned TrustManagerFactory
must already be initialized and ready to use.
The mapper is only used when the server has SNI enabled and the client indicated a server name.
The returned function may return null
in which case TrustOptions.getTrustManagerFactory(Vertx)
is used as fallback.trustManagerMapper
in interface TrustOptions
vertx
- the vertx instanceException
public abstract KeyStoreOptionsBase copy()
copy
in interface KeyCertOptions
copy
in interface TrustOptions
Copyright © 2023 Eclipse. All rights reserved.