- java.lang.Object
-
- org.xnio.ssl.JsseSslUtils
-
public final class JsseSslUtils extends java.lang.Object
Utility methods for creating JSSE constructs and configuring them via XNIO option maps.- Author:
- David M. Lloyd
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.net.ssl.SSLContext
createSSLContext(javax.net.ssl.KeyManager[] keyManagers, javax.net.ssl.TrustManager[] trustManagers, java.security.SecureRandom secureRandom, OptionMap optionMap)
Create a new SSL context, configured from an option map and the given parameters.static javax.net.ssl.SSLContext
createSSLContext(OptionMap optionMap)
Create a new SSL context, configured from an option map.static javax.net.ssl.SSLEngine
createSSLEngine(javax.net.ssl.SSLContext sslContext, OptionMap optionMap, java.net.InetSocketAddress peerAddress)
Create a new client mode SSL engine, configured from an option map.
-
-
-
Method Detail
-
createSSLContext
public static javax.net.ssl.SSLContext createSSLContext(OptionMap optionMap) throws java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException, java.security.KeyManagementException
Create a new SSL context, configured from an option map.- Parameters:
optionMap
- the SSL context options- Returns:
- a new context
- Throws:
java.security.NoSuchProviderException
- if there is no matching providerjava.security.NoSuchAlgorithmException
- if there is no matching algorithmjava.security.KeyManagementException
- if the context initialization fails
-
createSSLContext
public static javax.net.ssl.SSLContext createSSLContext(javax.net.ssl.KeyManager[] keyManagers, javax.net.ssl.TrustManager[] trustManagers, java.security.SecureRandom secureRandom, OptionMap optionMap) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.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:
java.security.NoSuchProviderException
- if there is no matching providerjava.security.NoSuchAlgorithmException
- if there is no matching algorithmjava.security.KeyManagementException
- if the context initialization fails
-
createSSLEngine
public static javax.net.ssl.SSLEngine createSSLEngine(javax.net.ssl.SSLContext sslContext, OptionMap optionMap, java.net.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
-
-