IotHubSasTokenHardwareAuthenticationProvider Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. auth. IotHubAuthenticationProvider - com.
microsoft. azure. sdk. iot. device. auth. IotHubSasTokenAuthenticationProvider - com.
microsoft. azure. sdk. iot. device. auth. IotHubSasTokenHardwareAuthenticationProvider
- com.
- com.
- com.
public class IotHubSasTokenHardwareAuthenticationProvider
extends IotHubSasTokenAuthenticationProvider
Field Summary
Modifier and Type | Field and Description |
---|---|
protected
Security |
securityProvider |
Constructor Summary
Constructor | Description |
---|---|
IotHubSasTokenHardwareAuthenticationProvider(String hostname, String gatewayHostname, String deviceId, String moduleId, SecurityProvider securityProvider) |
Creates a Sas Token based authentication object that uses the provided security provider to produce sas tokens. |
Method Summary
Modifier and Type | Method and Description |
---|---|
boolean | canRefreshToken() |
javax.net.ssl.SSLContext |
getSSLContext()
Getter for SSLContext |
char[] |
getSasToken()
Getter for Sas |
boolean |
isAuthenticationProviderRenewalNecessary()
Returns true if the this authentication provider is no longer valid. |
void |
setIotHubTrustedCert(String certificate)
Setter for the user trusted certificate |
void |
setPathToIotHubTrustedCert(String pathToCertificate)
Setter for the providing trusted certificate. |
Methods inherited from IotHubAuthenticationProvider
Methods inherited from IotHubSasTokenAuthenticationProvider
Methods inherited from java.lang.Object
Field Details
securityProvider
protected SecurityProviderTpm securityProvider
Constructor Details
IotHubSasTokenHardwareAuthenticationProvider
public IotHubSasTokenHardwareAuthenticationProvider(String hostname, String gatewayHostname, String deviceId, String moduleId, SecurityProvider securityProvider)
Creates a Sas Token based authentication object that uses the provided security provider to produce sas tokens.
Parameters:
Throws:
Method Details
canRefreshToken
public boolean canRefreshToken()
Overrides:
IotHubSasTokenHardwareAuthenticationProvider.canRefreshToken()getSSLContext
public SSLContext getSSLContext()
Getter for SSLContext
Overrides:
IotHubSasTokenHardwareAuthenticationProvider.getSSLContext()Returns:
Throws:
getSasToken
public char[] getSasToken()
Getter for SasToken. If the saved token has expired, this method shall renew it if possible
Overrides:
IotHubSasTokenHardwareAuthenticationProvider.getSasToken()Returns:
Throws:
isAuthenticationProviderRenewalNecessary
public boolean isAuthenticationProviderRenewalNecessary()
Returns true if the this authentication provider is no longer valid. If true, users will need to create a new DeviceClient instance to get a new authentication provider. The most common case for this is if the user provides a SAS token, but no symmetric key, and that SAS token has expired. At that point, the user's client won't be able to authenticate anymore.
Overrides:
IotHubSasTokenHardwareAuthenticationProvider.isAuthenticationProviderRenewalNecessary()Returns:
setIotHubTrustedCert
public void setIotHubTrustedCert(String certificate)
Setter for the user trusted certificate
Overrides:
IotHubSasTokenHardwareAuthenticationProvider.setIotHubTrustedCert(String certificate)Parameters:
setPathToIotHubTrustedCert
public void setPathToIotHubTrustedCert(String pathToCertificate)
Setter for the providing trusted certificate.
Overrides:
IotHubSasTokenHardwareAuthenticationProvider.setPathToIotHubTrustedCert(String pathToCertificate)Parameters:
Applies to
Azure SDK for Java