IotHubSasTokenAuthenticationProvider 类

定义

public class IotHubSasTokenAuthenticationProvider extends IotHubAuthenticationProvider
继承
java.lang.Object
IotHubSasTokenAuthenticationProvider

继承成员

构造函数

IotHubSasTokenAuthenticationProvider(String hostname, String gatewayHostname, String deviceId, String moduleId)
IotHubSasTokenAuthenticationProvider(String hostname, String gatewayHostname, String deviceId, String moduleId, long tokenValidSecs, int timeBufferPercentage)
IotHubSasTokenAuthenticationProvider(String hostname, String gatewayHostname, String deviceId, String moduleId, SSLContext sslContext)

字段

ENCODING_FORMAT_NAME
MILLISECONDS_PER_SECOND
MINIMUM_EXPIRATION_TIME_OFFSET
sasToken
timeBufferPercentage

The percentage of a sas token's life that will happen before it should be renewed. Between 1 and 100

tokenValidSecs

The number of seconds after which the generated SAS token for a message will become invalid. We also use the expiry time, which is computed as currentTime() + DEVICE_KEY_VALID_LENGTH 

</code> , as a salt when generating our SAS token. </p>

方法

canRefreshToken()
getMillisecondsBeforeProactiveRenewal()
getSasToken()
getTokenValidSecs()
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.

setTokenValidSecs(long tokenValidSecs)
shouldRefreshToken(boolean proactivelyRenew)

Returns true if the saved token should be refreshed

适用于