public class DefaultTcpSSLContextSupport extends Object implements TcpSSLContextSupport
TcpSSLContextSupport
; uses a
'TLS' (by default) SSLContext
, initialized with 'JKS'
keystores, managed by 'SunX509' Key and Trust managers.Constructor and Description |
---|
DefaultTcpSSLContextSupport(String keyStore,
String trustStore,
String keyStorePassword,
String trustStorePassword)
Prepares for the creation of an SSLContext using the supplied
key/trust stores and passwords.
|
Modifier and Type | Method and Description |
---|---|
SSLContext |
getSSLContext()
Gets an SSLContext.
|
void |
setProtocol(String protocol)
The protocol used in
SSLContext.getInstance(String) ; default "TLS". |
public DefaultTcpSSLContextSupport(String keyStore, String trustStore, String keyStorePassword, String trustStorePassword)
keyStore
- A Resource
pattern pointing to the keyStore.trustStore
- A Resource
pattern pointing to the trustStore.keyStorePassword
- The password for the keyStore.trustStorePassword
- The password for the trustStore.public SSLContext getSSLContext() throws GeneralSecurityException, IOException
TcpSSLContextSupport
getSSLContext
in interface TcpSSLContextSupport
GeneralSecurityException
- Any GeneralSecurityException.IOException
- Any IOException.public void setProtocol(String protocol)
SSLContext.getInstance(String)
; default "TLS".protocol
- The protocol.