IotHubSSLContext Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. service. auth. IotHubSSLContext
- com.
public class IotHubSSLContext
A simple wrapper for holding the SSLContext used by all connections from clients in this library to the service.
Constructor Summary
Constructor | Description |
---|---|
IotHubSSLContext() |
Create a default IotHubSSLContext that trusts the certificates stored in your physical device's Trusted Root Certification Authorities certificate store. This IotHubSSLContext can be used for connections that use symmetric key authentication, but cannot be used for connections that use x509 authentication. |
IotHubSSLContext(SSLContext sslContext) |
Create an IotHubSSLContext that will use the provided sslContext rather than create one based on your device's Trusted Root Certification Authorities certificate store. |
Method Summary
Modifier and Type | Method and Description |
---|---|
SSLContext |
getSSLContext()
Get the SSLContext that will be used during the TLS handshake when establishing a connection to the service. |
SSLContext |
getSSLContextFromFile(String trustedCertificatesFilePath)
Create an IotHubSSLContext that trusts the PEM formatted certificates stored in a file with the provided path. |
SSLContext |
getSSLContextFromString(String trustedCertificates)
Create an IotHubSSLContext that trusts the PEM formatted certificates stored in the provided trustedCertificates. |
Constructor Details
IotHubSSLContext
public IotHubSSLContext()
Create a default IotHubSSLContext that trusts the certificates stored in your physical device's Trusted Root Certification Authorities certificate store. This IotHubSSLContext can be used for connections that use symmetric key authentication, but cannot be used for connections that use x509 authentication.
IotHubSSLContext
public IotHubSSLContext(SSLContext sslContext)
Create an IotHubSSLContext that will use the provided sslContext rather than create one based on your device's Trusted Root Certification Authorities certificate store.
Parameters:
Method Details
getSSLContext
public SSLContext getSSLContext()
Get the SSLContext that will be used during the TLS handshake when establishing a connection to the service.
Returns:
getSSLContextFromFile
public static SSLContext getSSLContextFromFile(String trustedCertificatesFilePath)
Create an IotHubSSLContext that trusts the PEM formatted certificates stored in a file with the provided path.
Parameters:
Returns:
Throws:
getSSLContextFromString
public static SSLContext getSSLContextFromString(String trustedCertificates)
Create an IotHubSSLContext that trusts the PEM formatted certificates stored in the provided trustedCertificates.
Parameters:
Returns:
Throws:
Applies to
Azure SDK for Java