java.lang.Object
io.helidon.common.tls.ConfiguredTlsManager
- All Implemented Interfaces:
NamedService,TlsManager
The default configured
TlsManager implementation.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConfiguredTlsManager(String name, String type) Configured tls manager constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected KeyManagerFactorybuildKmf(TlsConfig target, SecureRandom secureRandom, PrivateKey privateKey, Certificate[] certificates) Build the key manager factory.protected TrustManagerFactoryCreate a new trust manager factory based on the configuration (i.e., the algorithm and provider).voidAlways called before any other method on this type.protected voidinitSslContext(TlsConfig tlsConfig, SecureRandom secureRandom, KeyManager[] keyManagers, TrustManager[] trustManagers) Initialize and set theSSLContexton this manager instance.protected KeyStoreinternalKeystore(TlsConfig tlsConfig) Creates an internal keystore and loads it with no password and no data.The key manager in use.name()Name of this implementation, as provided inConfiguredProvider.create(Config, String).voidThis method will multiplex the call to allTlsReloadableComponents that are being managed by this manager.protected voidreload(Optional<X509KeyManager> keyManager, Optional<X509TrustManager> trustManager) Reload the current SSL context with the provided key manager and trust manager (if defined).protected SecureRandomsecureRandom(TlsConfig tlsConfig) Load secure random.SSL context created by this manager.protected TrustManagerFactoryCreates a trust all trust manager factory.The trust manager in use.type()Type of this implementation, to distinguish instances of same type, with differentNamedService.name().
-
Constructor Details
-
ConfiguredTlsManager
Configured tls manager constructor.- Parameters:
name- the manager nametype- the manager type
-
-
Method Details
-
name
Description copied from interface:NamedServiceName of this implementation, as provided inConfiguredProvider.create(Config, String).- Specified by:
namein interfaceNamedService- Returns:
- name of this service
-
type
Description copied from interface:NamedServiceType of this implementation, to distinguish instances of same type, with differentNamedService.name(). Use for exampleConfiguredProvider.configKey()to define the type.- Specified by:
typein interfaceNamedService- Returns:
- type of this service
-
sslContext
Description copied from interface:TlsManagerSSL context created by this manager. This method is called only afterTlsManager.init(TlsConfig)and only ifTlsConfigBlueprint.enabled()istrue.- Specified by:
sslContextin interfaceTlsManager- Returns:
- the SSL context to use
-
init
Description copied from interface:TlsManagerAlways called before any other method on this type. This method is only called when TLS is enabled. In case the TLS is disabled, none of the methods on this type can be called.- Specified by:
initin interfaceTlsManager- Parameters:
tlsConfig- TLS configuration
-
reload
Description copied from interface:TlsManagerThis method will multiplex the call to allTlsReloadableComponents that are being managed by this manager.- Specified by:
reloadin interfaceTlsManager- Parameters:
tls- the new tls instance- See Also:
-
keyManager
Description copied from interface:TlsManagerThe key manager in use.- Specified by:
keyManagerin interfaceTlsManager- Returns:
- key manager
-
trustManager
Description copied from interface:TlsManagerThe trust manager in use.- Specified by:
trustManagerin interfaceTlsManager- Returns:
- trust manager
-
reload
Reload the current SSL context with the provided key manager and trust manager (if defined).- Parameters:
keyManager- key manager to usetrustManager- trust manager to use
-
initSslContext
protected void initSslContext(TlsConfig tlsConfig, SecureRandom secureRandom, KeyManager[] keyManagers, TrustManager[] trustManagers) Initialize and set theSSLContexton this manager instance.- Parameters:
tlsConfig- the tls configurationsecureRandom- the secure randomkeyManagers- the key managerstrustManagers- the trust managers
-
secureRandom
Load secure random.- Parameters:
tlsConfig- TLS configuration- Returns:
- secure random
-
buildKmf
protected KeyManagerFactory buildKmf(TlsConfig target, SecureRandom secureRandom, PrivateKey privateKey, Certificate[] certificates) Build the key manager factory.- Parameters:
target- the tls configurationsecureRandom- the secure randomprivateKey- the private key for the key storecertificates- the certificates for the keystore- Returns:
- a key manager factory instance
-
internalKeystore
Creates an internal keystore and loads it with no password and no data.- Parameters:
tlsConfig- TLS config- Returns:
- a new keystore
-
createTmf
Create a new trust manager factory based on the configuration (i.e., the algorithm and provider).- Parameters:
tlsConfig- TLS config- Returns:
- a new trust manager factory
-
trustAllTmf
Creates a trust all trust manager factory.- Returns:
- a new trust manager factory trusting all
-