Module 
Package org.xnio.ssl

Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 provider
        java.security.NoSuchAlgorithmException - if there is no matching algorithm
        java.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, 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:
        java.security.NoSuchProviderException - if there is no matching provider
        java.security.NoSuchAlgorithmException - if there is no matching algorithm
        java.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 context
        optionMap - the SSL options
        peerAddress - the peer address of the connection
        Returns:
        the configured SSL engine