你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
IotHubAuthenticationProvider Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. auth. IotHubAuthenticationProvider
- com.
public abstract class IotHubAuthenticationProvider
Base class for providing authentication for a Device Client or Module Client, including x509 and SAS based authentication.
Field Summary
Modifier and Type | Field and Description |
---|---|
protected java.lang.String | deviceId |
protected java.lang.String | gatewayHostname |
protected java.lang.String | hostname |
protected
Iot |
iotHubSSLContext |
protected java.lang.String | iotHubTrustedCert |
protected java.lang.String | moduleId |
protected java.lang.String | pathToIotHubTrustedCert |
protected boolean | sslContextNeedsUpdate |
Constructor Summary
Method Summary
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDeviceId()
Get the device |
java.lang.String |
getGatewayHostname()
Get the gateway |
java.lang.String |
getHostname()
Get the hostname |
java.lang.String | getIotHubTrustedCert() |
java.lang.String |
getModuleId()
Get the module id |
java.lang.String | getPathToIotHubTrustedCert() |
javax.net.ssl.SSLContext | getSSLContext() |
void |
setIotHubTrustedCert(String certificate)
Setter for the user trusted certificate |
void |
setPathToIotHubTrustedCert(String pathToCertificate)
Setter for the providing trusted certificate. |
void | setSSLContext(SSLContext sslContext) |
Methods inherited from java.lang.Object
Field Details
deviceId
protected String deviceId
gatewayHostname
protected String gatewayHostname
hostname
protected String hostname
iotHubSSLContext
protected IotHubSSLContext iotHubSSLContext
iotHubTrustedCert
protected String iotHubTrustedCert
moduleId
protected String moduleId
pathToIotHubTrustedCert
protected String pathToIotHubTrustedCert
sslContextNeedsUpdate
protected boolean sslContextNeedsUpdate
Constructor Details
IotHubAuthenticationProvider
public IotHubAuthenticationProvider(String hostname, String gatewayHostname, String deviceId, String moduleId)
Parameters:
IotHubAuthenticationProvider
public IotHubAuthenticationProvider(String hostname, String gatewayHostname, String deviceId, String moduleId, SSLContext sslContext)
Parameters:
Method Details
getDeviceId
public String getDeviceId()
Get the deviceId
Returns:
getGatewayHostname
public String getGatewayHostname()
Get the gatewayHostname
Returns:
getHostname
public String getHostname()
Get the hostname
Returns:
getIotHubTrustedCert
public String getIotHubTrustedCert()
getModuleId
public String getModuleId()
Get the module id
Returns:
getPathToIotHubTrustedCert
public String getPathToIotHubTrustedCert()
getSSLContext
public SSLContext getSSLContext()
Throws:
setIotHubTrustedCert
public void setIotHubTrustedCert(String certificate)
Setter for the user trusted certificate
Parameters:
setPathToIotHubTrustedCert
public void setPathToIotHubTrustedCert(String pathToCertificate)
Setter for the providing trusted certificate.
Parameters:
setSSLContext
public void setSSLContext(SSLContext sslContext)
Parameters: