public class IotHubSSLContext extends Object
| Constructor and Description |
|---|
IotHubSSLContext()
Creates a SSLContext for the IotHub.
|
IotHubSSLContext(SSLContext sslContext)
Constructor that takes and saves an SSLContext object
|
IotHubSSLContext(String trustedCert,
boolean isPath)
Creates a default SSLContext for the IotHub with the specified certificate.
|
IotHubSSLContext(String publicKeyCertificateString,
String privateKeyString)
Constructor that takes a public key certificate and private key pair.
|
IotHubSSLContext(String publicKeyCertificateString,
String privateKeyString,
String cert,
boolean isPath)
Creates a default SSLContext for the IotHub with the specified certificate.
|
| Modifier and Type | Method and Description |
|---|---|
SSLContext |
getSSLContext()
Getter for the IotHubSSLContext
|
public IotHubSSLContext()
throws KeyStoreException,
KeyManagementException,
IOException,
CertificateException,
NoSuchAlgorithmException
KeyStoreException - if no Provider supports a KeyStoreSpi implementation for the specified type or
if the keystore has not been initialized,
or the given alias already exists and does not identify an entry containing a trusted certificate,
or this operation fails for some other reason.KeyManagementException - As per https://docs.oracle.com/javase/7/docs/api/java/security/KeyManagementException.htmlIOException - If the certificate provided was null or invalidCertificateException - As per https://docs.oracle.com/javase/7/docs/api/java/security/cert/CertificateException.htmlNoSuchAlgorithmException - if the default SSL Context cannot be createdpublic IotHubSSLContext(SSLContext sslContext)
sslContext - the ssl context to savepublic IotHubSSLContext(String trustedCert, boolean isPath) throws KeyStoreException, KeyManagementException, IOException, CertificateException, NoSuchAlgorithmException
trustedCert - the certificate to be trustedisPath - if the trustedCert is a path to the trusted cert, or if it is the certificate itselfKeyStoreException - if no Provider supports a KeyStoreSpi implementation for the specified type or
if the keystore has not been initialized,
or the given alias already exists and does not identify an entry containing a trusted certificate,
or this operation fails for some other reason.KeyManagementException - As per https://docs.oracle.com/javase/7/docs/api/java/security/KeyManagementException.htmlIOException - If the certificate provided was null or invalidCertificateException - As per https://docs.oracle.com/javase/7/docs/api/java/security/cert/CertificateException.htmlNoSuchAlgorithmException - if the default SSL Context cannot be createdpublic IotHubSSLContext(String publicKeyCertificateString, String privateKeyString, String cert, boolean isPath) throws KeyStoreException, KeyManagementException, IOException, CertificateException, NoSuchAlgorithmException, UnrecoverableKeyException
publicKeyCertificateString - the public key for x509 authenticationprivateKeyString - the private key for x509 authenticationcert - the trusted certificateisPath - If the provided cert is a path, or the actual certificate itselfKeyStoreException - if no Provider supports a KeyStoreSpi implementation for the specified type or
if the keystore has not been initialized,
or the given alias already exists and does not identify an entry containing a trusted certificate,
or this operation fails for some other reason.KeyManagementException - As per https://docs.oracle.com/javase/7/docs/api/java/security/KeyManagementException.htmlIOException - If the certificate provided was null or invalidCertificateException - As per https://docs.oracle.com/javase/7/docs/api/java/security/cert/CertificateException.htmlNoSuchAlgorithmException - if the default SSL Context cannot be createdUnrecoverableKeyExceptionpublic IotHubSSLContext(String publicKeyCertificateString, String privateKeyString) throws KeyManagementException, IOException, CertificateException, KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException
publicKeyCertificateString - The PEM formatted public key certificate stringprivateKeyString - The PEM formatted private key stringKeyManagementException - If the SSLContext could not be initializedIOException - If an IO exception occursCertificateException - If a certificate cannot be loadedKeyStoreException - If the provided certificates cannot be loaded into the JVM keystoreUnrecoverableKeyException - if accessing the passphrase protected keystore fails due to the keyNoSuchAlgorithmException - if the default SSLContext cannot be generatedpublic SSLContext getSSLContext()
Copyright © 2019. All rights reserved.