Class MqttUtils


public class MqttUtils extends Object
This Utility class provides methods for handling MQTT-related operations.
  • Constructor Details

    • MqttUtils

      public MqttUtils()
  • Method Details

    • createSslSocketFactory

      public static SSLSocketFactory createSslSocketFactory(String cert, String privateKey, String trustStore)
      Creates and returns an SSLSocketFactory for establishing secure connections in MQTT.

      This method initializes an SSL context using the provided certificate, private key and server truststore information, allowing the creation of an SSLSocketFactory with the configured security settings.

      cert - The client's certificate as String.
      privateKey - The private key as String.
      trustStore - The server's trust store as String.
      An SSLSocketFactory configured with the specified security settings.
      RuntimeException - If there is an error during the creation of the SSLSocketFactory.