com.jscape.inet.ipclientssl

## Class SecureSocket

- java.lang.Object
- - com.jscape.inet.ipclientssl.SecureSocket

-     public class SecureSocket
      extends java.lang.Object

  Utility class for obtaining secure SSL/TLS sockets

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SecureSocket(java.net.Socket socket, javax.net.ssl.SSLContext context)` Prevents this class from being instantiated

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.net.ssl.SSLContext` | `getContext()` Gets an SSLContext
    `java.net.Socket` | `getSocket()` Secures a socket using the provided SSL context and socket.
    `void` | `setClientCertificates(java.lang.String filename, java.lang.String password)` Sets client certificates
    `void` | `setClientCertificates(java.lang.String filename, java.lang.String password, java.lang.String clientStoreType)` Sets the client certificates
    `void` | `setServerCertificates(java.lang.String filename, java.lang.String password)` Sets server certificates
    `void` | `setServerCertificates(java.lang.String filename, java.lang.String password, java.lang.String serverStoreType)` Sets the trusted server certificates.

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

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

- - ### Constructor Detail

    - #### SecureSocket

          public SecureSocket(java.net.Socket socket,
                              javax.net.ssl.SSLContext context)

      Prevents this class from being instantiated
      Parameters:
        `socket` - the socket
        `context` - the context

  - ### Method Detail

    - #### getSocket

          public java.net.Socket getSocket()
                                    throws java.lang.Exception

      Secures a socket using the provided SSL context and socket.
      Returns:
        a secured Socket
      Throws:
        `java.lang.Exception` - if an error occurs

    - #### setClientCertificates

          public void setClientCertificates(java.lang.String filename,
                                            java.lang.String password,
                                            java.lang.String clientStoreType)
                                     throws java.lang.Exception

      Sets the client certificates
      Parameters:
        `filename` - the keystore filename
        `password` - the file password
        `clientStoreType` - the store type
      Throws:
        `java.lang.Exception` - if an error occurs

    - #### setClientCertificates

          public void setClientCertificates(java.lang.String filename,
                                            java.lang.String password)
                                     throws java.lang.Exception

      Sets client certificates
      Parameters:
        `filename` - the keystore filename
        `password` - the keystore password
      Throws:
        `java.lang.Exception` - if an exception occurs

    - #### setServerCertificates

          public void setServerCertificates(java.lang.String filename,
                                            java.lang.String password,
                                            java.lang.String serverStoreType)
                                     throws java.lang.Exception

      Sets the trusted server certificates.
      Parameters:
        `filename` - the trust store filename
        `password` - the store password
        `serverStoreType` - the store type
      Throws:
        `java.lang.Exception` - if an error occurs

    - #### setServerCertificates

          public void setServerCertificates(java.lang.String filename,
                                            java.lang.String password)
                                     throws java.lang.Exception

      Sets server certificates
      Parameters:
        `filename` - the keystore filename
        `password` - the keystore password
      Throws:
        `java.lang.Exception` - if an exception occurs

    - #### getContext

          public javax.net.ssl.SSLContext getContext()
                                              throws java.lang.Exception

      Gets an SSLContext
      Returns:
        an SSLContext
      Throws:
        `java.lang.Exception` - if an error occurs

Copyright © JSCAPE LLC. 1999-2021. All Rights Reserved