Class MqttUtils

java.lang.Object
io.openems.edge.controller.api.mqtt.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.

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