IotHubSasTokenHardwareAuthenticationProvider Class

public class IotHubSasTokenHardwareAuthenticationProvider extends IotHubSasTokenAuthenticationProvider

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()
char [] getSasToken()

Getter for SasToken. If the saved token has expired, this method shall renew it if possible

boolean isAuthenticationProviderRenewalNecessary()

Inherited Members

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:

hostname - The host name of the hub to authenticate against
gatewayHostname - The gateway hostname to use, or null if connecting to an IotHub
deviceId - The unique id of the device to authenticate
moduleId - the module id. May be null if not using a module
securityProvider - the security provider to use for authentication

Throws:

IOException - if the provided securityProvider throws while retrieving a sas token or ssl context instance

Method Details

canRefreshToken

public boolean canRefreshToken()

getSasToken

public char [] getSasToken()

Getter for SasToken. If the saved token has expired, this method shall renew it if possible

Returns:

The value of SasToken

Throws:

IOException - if generating the sas token from the TPM fails

isAuthenticationProviderRenewalNecessary

public boolean isAuthenticationProviderRenewalNecessary()

Returns:

always returns false as the hardware authentication mechanism will never need to be updated with a new key or token

Applies to