Package org.xnio.ssl
Class JsseSslUtils
java.lang.Object
org.xnio.ssl.JsseSslUtils
Utility methods for creating JSSE constructs and configuring them via XNIO option maps.
- Author:
- David M. Lloyd
-
Method Summary
Modifier and TypeMethodDescriptionstatic SSLContext
createSSLContext
(KeyManager[] keyManagers, TrustManager[] trustManagers, SecureRandom secureRandom, OptionMap optionMap) Create a new SSL context, configured from an option map and the given parameters.static SSLContext
createSSLContext
(OptionMap optionMap) Create a new SSL context, configured from an option map.static SSLEngine
createSSLEngine
(SSLContext sslContext, OptionMap optionMap, InetSocketAddress peerAddress) Create a new client mode SSL engine, configured from an option map.
-
Method Details
-
createSSLContext
public static SSLContext createSSLContext(OptionMap optionMap) throws NoSuchProviderException, NoSuchAlgorithmException, KeyManagementException Create a new SSL context, configured from an option map.- Parameters:
optionMap
- the SSL context options- Returns:
- a new context
- Throws:
NoSuchProviderException
- if there is no matching providerNoSuchAlgorithmException
- if there is no matching algorithmKeyManagementException
- if the context initialization fails
-
createSSLContext
public static SSLContext createSSLContext(KeyManager[] keyManagers, TrustManager[] trustManagers, SecureRandom secureRandom, OptionMap optionMap) throws NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException Create a new SSL context, configured from an option map and the given parameters.- Parameters:
keyManagers
- the key managers to use, ornull
to configure from the option maptrustManagers
- the trust managers to use, ornull
to configure from the option mapsecureRandom
- the secure RNG to use, ornull
to choose a system defaultoptionMap
- the SSL context options- Returns:
- a new context
- Throws:
NoSuchProviderException
- if there is no matching providerNoSuchAlgorithmException
- if there is no matching algorithmKeyManagementException
- if the context initialization fails
-
createSSLEngine
public static SSLEngine createSSLEngine(SSLContext sslContext, OptionMap optionMap, InetSocketAddress peerAddress) Create a new client mode SSL engine, configured from an option map.- Parameters:
sslContext
- the SSL contextoptionMap
- the SSL optionspeerAddress
- the peer address of the connection- Returns:
- the configured SSL engine
-