Class TribesSslContext

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class TribesSslContext
    extends java.lang.Object
    implements java.lang.AutoCloseable
    The pair (client and server) of TLS contexts used by a Tribes channel.
    • Constructor Summary

      Constructors 
      Constructor Description
      TribesSslContext​(java.lang.String identity, java.lang.String key, java.lang.String digest, java.lang.String protocol)
      Creates the pair of client and server TLS contexts to be used by a Tribes channel.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      javax.net.ssl.SSLEngine createClientEngine()
      Creates a new SSL engine for client-side use.
      javax.net.ssl.SSLEngine createServerEngine()
      Creates a new SSL engine for server-side use.
      java.lang.String getImplementationName()
      Returns the name of the TLS implementation in use.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TribesSslContext

        public TribesSslContext​(java.lang.String identity,
                                java.lang.String key,
                                java.lang.String digest,
                                java.lang.String protocol)
                         throws java.lang.Exception
        Creates the pair of client and server TLS contexts to be used by a Tribes channel. The OpenSSL FFM implementation is used where available, otherwise the Tomcat Native implementation is used.
        Parameters:
        identity - The pre-shared key identity
        key - The pre-shared key as a hex encoded string
        digest - The name of the message digest algorithm used to derive the pre-shared key, for example SHA256
        protocol - The TLS protocol name, for example TLSv1.3
        Throws:
        java.lang.Exception - if the TLS contexts could not be created
    • Method Detail

      • createClientEngine

        public javax.net.ssl.SSLEngine createClientEngine()
        Creates a new SSL engine for client-side use.
        Returns:
        the new client SSL engine
      • createServerEngine

        public javax.net.ssl.SSLEngine createServerEngine()
        Creates a new SSL engine for server-side use.
        Returns:
        the new server SSL engine
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • getImplementationName

        public java.lang.String getImplementationName()
        Returns the name of the TLS implementation in use.
        Returns:
        TLS-OpenSSL-FFM if the OpenSSL FFM implementation is used, otherwise TLS-OpenSSL