IotHubSasToken Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. auth. IotHubSasToken
- com.
public final class IotHubSasToken
Grants device access to an IoT Hub for the specified amount of time.
Constructor Summary
Modifier | Constructor | Description | |
---|---|---|---|
protected | IotHubSasToken() | ||
IotHubSasToken(String hostname, String deviceId, String deviceKey, String sharedAccessToken, String moduleId, long expiryTime) |
Constructor. |
Method Summary
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
buildSharedAccessToken(String audience, String signature, long expiry)
Creates a shared access token from the provided audience, signature and expiry time |
java.lang.String | getSasToken() |
static boolean |
isExpired(String sasToken)
Returns if the provided sas |
java.lang.String |
toString()
Returns the string representation of the SAS token. |
Methods inherited from java.lang.Object
Constructor Details
IotHubSasToken
protected IotHubSasToken()
IotHubSasToken
public IotHubSasToken(String hostname, String deviceId, String deviceKey, String sharedAccessToken, String moduleId, long expiryTime)
Constructor. Generates a SAS token that grants access to an IoT Hub for the specified amount of time.
Parameters:
Method Details
buildSharedAccessToken
public static String buildSharedAccessToken(String audience, String signature, long expiry)
Creates a shared access token from the provided audience, signature and expiry time
Parameters:
Returns:
getSasToken
public String getSasToken()
isExpired
public static boolean isExpired(String sasToken)
Returns if the provided sasToken has expired yet or not
Parameters:
Returns:
toString
public String toString()
Returns the string representation of the SAS token.
Overrides:
IotHubSasToken.toString()Returns:
Applies to
Azure SDK for Java