Class TlsConfig

Object
com.zebra.sdk.comm.TlsConfig

public class TlsConfig extends Object
TLS configuration for establishing secure connections.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Input stream containing the CA certificate used for TLS validation.
    final TlsMode
    Specifies the TLS validation mode (Trust All, Validate using JVM trust store, or Validate using certificate file).
    final TrustManager[]
    Array of custom trust managers used when validating with the Java keystore or a custom trust configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    static TlsConfig
    Loads a CA certificate from a CRT, CER, or PEM file and creates a TLS configuration that validates against it.
    static TlsConfig
    Creates a configuration that accepts all TLS certificates without validation.
    static TlsConfig
    Creates a configuration that uses the default JVM keystore (cacerts) for certificate validation.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mode

      public final TlsMode mode
      Specifies the TLS validation mode (Trust All, Validate using JVM trust store, or Validate using certificate file).
    • caCertificateStream

      public final InputStream caCertificateStream
      Input stream containing the CA certificate used for TLS validation. Only applicable when validating with a certificate file.
    • trustManagers

      public final TrustManager[] trustManagers
      Array of custom trust managers used when validating with the Java keystore or a custom trust configuration.
  • Method Details

    • trustAll

      public static TlsConfig trustAll()
      Creates a configuration that accepts all TLS certificates without validation.
      Returns:
      trustAll — a TlsConfig instance configured to trust all certificates.
    • trustJavaKeyStore

      public static TlsConfig trustJavaKeyStore() throws ConnectionException
      Creates a configuration that uses the default JVM keystore (cacerts) for certificate validation.
      Returns:
      trustJavaKeyStore — a TLS configuration using the JVM's trusted CA certificates.
      Throws:
      ConnectionException
    • fromCertificateFile

      public static TlsConfig fromCertificateFile(String filePath) throws ConnectionException
      Loads a CA certificate from a CRT, CER, or PEM file and creates a TLS configuration that validates against it.
      Parameters:
      filePath - — The filesystem path to the certificate file.
      Returns:
      fromCertificateFile — a TLS configuration created from the provided certificate.
      Throws:
      ConnectionException