public class IotHubSSLContext
extends java.lang.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(javax.net.ssl.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 |
|---|---|
javax.net.ssl.SSLContext |
getSSLContext()
Get the SSLContext that will be used during the TLS handshake when establishing a connection to the service.
|
static javax.net.ssl.SSLContext |
getSSLContextFromFile(java.lang.String trustedCertificatesFilePath)
Create an IotHubSSLContext that trusts the PEM formatted certificates stored in a file with the provided path.
|
static javax.net.ssl.SSLContext |
getSSLContextFromString(java.lang.String trustedCertificates)
Create an IotHubSSLContext that trusts the PEM formatted certificates stored in the provided trustedCertificates.
|
public IotHubSSLContext()
public IotHubSSLContext(javax.net.ssl.SSLContext sslContext)
sslContext - the SSLContext that will be used during the TLS handshake when establishing a connection to
the service.public javax.net.ssl.SSLContext getSSLContext()
public static javax.net.ssl.SSLContext getSSLContextFromString(java.lang.String trustedCertificates)
throws java.security.cert.CertificateException,
java.io.IOException,
java.security.KeyStoreException,
java.security.NoSuchAlgorithmException,
java.security.KeyManagementException
trustedCertificates - the PEM formatted certificates that this IotHubSSLContext will trust.java.security.cert.CertificateException - if the provided trustedCertificates are not PEM formatted and cannot be parsed.java.io.IOException - if the provided trustedCertificates cannot be read as a stream.java.security.KeyStoreException - if a key store cannot be created.java.security.NoSuchAlgorithmException - if your device cannot use x509 certificates or TLS SSLContexts.java.security.KeyManagementException - if the created SSLContext cannot be initialized.public static javax.net.ssl.SSLContext getSSLContextFromFile(java.lang.String trustedCertificatesFilePath)
throws java.security.cert.CertificateException,
java.io.IOException,
java.security.KeyStoreException,
java.security.NoSuchAlgorithmException,
java.security.KeyManagementException
trustedCertificatesFilePath - the absolute file path of the file that contains the PEM formatted
certificates that this IotHubSSLContext will trust.java.security.cert.CertificateException - if the provided trustedCertificates are not PEM formatted and cannot be parsed.java.io.IOException - if the provided trustedCertificates cannot be read as a stream.java.security.KeyStoreException - if a key store cannot be created.java.security.NoSuchAlgorithmException - if your device cannot use x509 certificates or TLS SSLContexts.java.security.KeyManagementException - if the created SSLContext cannot be initialized.Copyright © 2023. All rights reserved.