net.i2p.i2ptunnel

## Class SSLClientUtil

- java.lang.Object
- - net.i2p.i2ptunnel.SSLClientUtil

-     public class SSLClientUtil
      extends Object

  SSL server socket utilities for I2PTunnel clients.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SSLClientUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SSLServerSocketFactory` | `initializeFactory(Properties opts)` Sets up the SSLContext and sets the socket factory.
    `static boolean` | `verifyKeyStore(Properties opts)` Create a new selfsigned cert and keystore and pubkey cert if they don't exist.
    `static boolean` | `verifyKeyStore(Properties opts, String optPfx)` Create a new selfsigned cert and keystore and pubkey cert if they don't exist.
    `static boolean` | `verifyKeyStore(Properties opts, String optPfx, Set<String> altNames)` Create a new selfsigned cert and keystore and pubkey cert if they don't exist.

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

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

- - ### Constructor Detail

    - #### SSLClientUtil

          public SSLClientUtil()

  - ### Method Detail

    - #### initializeFactory

          public static SSLServerSocketFactory initializeFactory(Properties opts)
                                                          throws IOException

      Sets up the SSLContext and sets the socket factory. No option prefix allowed.
      Returns:
        factory, throws on all errors
      Throws:
        `IOException` - GeneralSecurityExceptions are wrapped in IOE for convenience

    - #### verifyKeyStore

          public static boolean verifyKeyStore(Properties opts)
                                        throws IOException

      Create a new selfsigned cert and keystore and pubkey cert if they don't exist. May take a while.
      Parameters:
        `opts` - in/out, updated if rv is true
      Returns:
        false if it already exists; if true, caller must save opts
      Throws:
        `IOException` - on creation fail

    - #### verifyKeyStore

          public static boolean verifyKeyStore(Properties opts,
                                               String optPfx)
                                        throws IOException

      Create a new selfsigned cert and keystore and pubkey cert if they don't exist. May take a while.
      Parameters:
        `opts` - in/out, updated if rv is true
        `optPfx` - add this prefix when getting/setting options
      Returns:
        false if it already exists; if true, caller must save opts
      Throws:
        `IOException` - on creation fail

    - #### verifyKeyStore

          public static boolean verifyKeyStore(Properties opts,
                                               String optPfx,
                                               Set<String> altNames)
                                        throws IOException

      Create a new selfsigned cert and keystore and pubkey cert if they don't exist. May take a while.
      Parameters:
        `opts` - in/out, updated if rv is true
        `optPfx` - add this prefix when getting/setting options
        `altNames` - the Subject Alternative Names. May be null. May contain hostnames and/or IP addresses. cname, localhost, 127.0.0.1, and ::1 will be automatically added.
      Returns:
        false if it already exists; if true, caller must save opts
      Throws:
        `IOException` - on creation fail