IotHubSasToken Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. auth. IotHubSasToken
- com.
public class IotHubSasToken
Grants device access to an IoT Hub for the specified amount of time.
Constructor Summary
Constructor | Description | |
---|---|---|
IotHubSasToken() | ||
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. |
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
buildSharedAccessToken(String audience, String signature, long expiry)
Creates a shared access token from the provided audience, signature and expiry time |
String | getSasToken() |
boolean |
isExpired(String sasToken)
Returns if the provided sasToken has expired yet or not |
String |
toString()
Returns the string representation of the SAS token. |
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.
Returns:
Applies to
Azure SDK for Java