Package com.zebra.sdk.comm
Class TlsConfig
Object
com.zebra.sdk.comm.TlsConfig
TLS configuration for establishing secure connections.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal InputStreamInput stream containing the CA certificate used for TLS validation.final TlsModeSpecifies 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 TypeMethodDescriptionstatic TlsConfigfromCertificateFile(String filePath) Loads a CA certificate from a CRT, CER, or PEM file and creates a TLS configuration that validates against it.static TlsConfigtrustAll()Creates a configuration that accepts all TLS certificates without validation.static TlsConfigCreates a configuration that uses the default JVM keystore (cacerts) for certificate validation.
-
Field Details
-
mode
Specifies the TLS validation mode (Trust All, Validate using JVM trust store, or Validate using certificate file). -
caCertificateStream
Input stream containing the CA certificate used for TLS validation. Only applicable when validating with a certificate file. -
trustManagers
Array of custom trust managers used when validating with the Java keystore or a custom trust configuration.
-
-
Method Details
-
trustAll
Creates a configuration that accepts all TLS certificates without validation.- Returns:
- trustAll — a TlsConfig instance configured to trust all certificates.
-
trustJavaKeyStore
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
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
-