
cool.mqtt.hooks.SecurityParams Maven / Gradle / Ivy
Show all versions of mqtt.cool-hook-java-api Show documentation
package cool.mqtt.hooks;
import java.nio.file.Path;
/**
* A wrapper of the parameters used to support the setting up of encrypted connections between the
* MQTT.Cool server and the target MQTT broker.
*/
public interface SecurityParams {
/**
* The standard name of the security protocol to be used, as specified in the
* Java
* Cryptography Architecture Standard Algorithm Name.
*
*If either {@code null} or empty string is returned, the {@code TLSv1.2} protocol will be
* used.
*
* @return the standard name of the security protocol, or {@code null} or empty string for the
* default value
*/
String getSecurityProtocol();
/**
* The absolute path to the JKS truststore, which contains the MQTT broker certificate to
* trust.
*
*
If {@code null} is returned, a default truststore will be determined according to the
* JSSE Reference Guide.
*
* @return the absolute path to the JKS truststore, or {@code null}
*/
Path getTruststorePath();
/**
* The password for the JKS truststore.
*
*
* The password will be used only if a truststore is provided by {@link #getTruststorePath()}.
*
* @return the password for the JSK truststore
*/
char[] getTruststorePassword();
/**
* The absolute path to the JKS keystore, which contains the client certificate and the
* private key to be used in the case the target MQTT broker requires client authentication.
*
*
If {@code null} is returned, a default keystore will be determined according to the
* JSSE Reference Guide.
*
* @return the absolute path to the JKS keystore, or {@code null}
*/
Path getKeystorePath();
/**
* The password for the JKS keystore.
*
*
The password will be used only if a keystore is provided by {@link #getKeystorePath()}.
*
* @return the password for the JKS keystore
*/
char[] getKeystorePassword();
/**
* The password for the private key stored into the JSK keystore.
*
*
The password will be used only if a keystore is provided by {@link #getKeystorePath()}.
*
* @return the password for the private key stored into the JSK keystore, or {@code null}
*/
char[] getPrivateKeyPassword();
}