Package org.kiwiproject.security
Interface TrustStoreConfigProvider
-
- All Known Subinterfaces:
KeyAndTrustStoreConfigProvider
- All Known Implementing Classes:
SecureEndpointsConfiguration
,SSLContextConfiguration
,TlsContextConfiguration
public interface TrustStoreConfigProvider
Defines a configuration interface for properties needed to create trust stores, and a contract to be able to create aSSLContext
andSSLSocketFactory
from this configuration.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
getProtocol()
The protocol to use.String
getTrustStorePassword()
The trust store password (plain text).String
getTrustStorePath()
The path to the trust store.default String
getTrustStoreType()
Trust store type.default boolean
isVerifyHostname()
Defaults totrue
.default SSLContext
toSSLContext()
Convert this configuration into aSSLContext
.default SSLSocketFactory
toSslSocketFactory()
Convert this configuration into aSSLSocketFactory
.
-
-
-
Method Detail
-
getProtocol
String getProtocol()
The protocol to use. Consider usingSSLContextProtocol
to ensure valid protocols.- Returns:
- protocol
- See Also:
SSLContextProtocol
-
getTrustStorePath
String getTrustStorePath()
The path to the trust store.- Returns:
- path to trust store
-
getTrustStorePassword
String getTrustStorePassword()
The trust store password (plain text).- Returns:
- trust store password
-
getTrustStoreType
default String getTrustStoreType()
Trust store type. Default is JKS.- Returns:
- trust store type
- See Also:
KeyStoreType.JKS
-
isVerifyHostname
default boolean isVerifyHostname()
Defaults totrue
.- Returns:
- true if hostname verification should be performed
-
toSSLContext
default SSLContext toSSLContext()
Convert this configuration into aSSLContext
.- Returns:
- a new SSLContext instance
- See Also:
KiwiSecurity.createSslContext(String, String, String, String, String, String, String)
-
toSslSocketFactory
default SSLSocketFactory toSslSocketFactory()
Convert this configuration into aSSLSocketFactory
.- Returns:
- a new SSLSocketFactory instance
- See Also:
toSSLContext()
-
-