public class IotHubSSLContext extends Object
| Constructor and Description |
|---|
IotHubSSLContext()
Create a default IotHubSSLContext that trusts the certificates stored in your physical device's
Trusted Root Certification Authorities certificate store.
|
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.
|
| 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.
|
static SSLContext |
getSSLContextFromFile(String trustedCertificatesFilePath)
Create an IotHubSSLContext that trusts the PEM formatted certificates stored in a file with the provided path.
|
static SSLContext |
getSSLContextFromString(String trustedCertificates)
Create an IotHubSSLContext that trusts the PEM formatted certificates stored in the provided trustedCertificates.
|
public IotHubSSLContext()
public IotHubSSLContext(SSLContext sslContext)
sslContext - the SSLContext that will be used during the TLS handshake when establishing a connection to
the service.public SSLContext getSSLContext()
public static SSLContext getSSLContextFromString(String trustedCertificates) throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException
trustedCertificates - the PEM formatted certificates that this IotHubSSLContext will trust.CertificateException - if the provided trustedCertificates are not PEM formatted and cannot be parsed.IOException - if the provided trustedCertificates cannot be read as a stream.KeyStoreException - if a key store cannot be created.NoSuchAlgorithmException - if your device cannot use x509 certificates or TLS SSLContexts.KeyManagementException - if the created SSLContext cannot be initialized.public static SSLContext getSSLContextFromFile(String trustedCertificatesFilePath) throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException
trustedCertificatesFilePath - the absolute file path of the file that contains the PEM formatted
certificates that this IotHubSSLContext will trust.CertificateException - if the provided trustedCertificates are not PEM formatted and cannot be parsed.IOException - if the provided trustedCertificates cannot be read as a stream.KeyStoreException - if a key store cannot be created.NoSuchAlgorithmException - if your device cannot use x509 certificates or TLS SSLContexts.KeyManagementException - if the created SSLContext cannot be initialized.Copyright © 2024. All rights reserved.