Package org.xnio.ssl

# Class JsseSslUtils

java.lang.Object
org.xnio.ssl.JsseSslUtils

public final class JsseSslUtils extends Object
Utility methods for creating JSSE constructs and configuring them via XNIO option maps.

Author:
  David M. Lloyd

## Method Summary

Modifier and Type
Method
Description
`static 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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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 provider
  `NoSuchAlgorithmException` - if there is no matching algorithm
  `KeyManagementException` - 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, or `null` to configure from the option map
  `trustManagers` - the trust managers to use, or `null` to configure from the option map
  `secureRandom` - the secure RNG to use, or `null` to choose a system default
  `optionMap` - the SSL context options
Returns:
  a new context
Throws:
  `NoSuchProviderException` - if there is no matching provider
  `NoSuchAlgorithmException` - if there is no matching algorithm
  `KeyManagementException` - 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 context
  `optionMap` - the SSL options
  `peerAddress` - the peer address of the connection
Returns:
  the configured SSL engine