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()
getRenewedSasToken(boolean proactivelyRenew, boolean forceRenewal)
getTokenValidSecs()
isRenewalNecessary()

Returns true if the saved sas token needs to be manually renewed by the user

setTokenValidSecs(long tokenValidSecs)
shouldRefreshToken(boolean proactivelyRenew)

Returns true if the saved token should be refreshed

适用于