public class IotHubSasTokenHsmAuthenticationProvider extends IotHubSasTokenWithRefreshAuthenticationProvider
ENCODING_FORMAT_NAME, MILLISECONDS_PER_SECOND, MINIMUM_EXPIRATION_TIME_OFFSET, sasToken, timeBufferPercentage, tokenValidSecsdeviceId, gatewayHostname, hostname, iotHubSSLContext, iotHubTrustedCert, moduleId, pathToIotHubTrustedCert, sslContextNeedsUpdate| Modifier and Type | Method and Description |
|---|---|
boolean |
canRefreshToken()
Returns true as the Hsm can always refresh the token
|
static IotHubSasTokenHsmAuthenticationProvider |
create(SignatureProvider signatureProvider,
String deviceId,
String moduleId,
String hostname,
String gatewayHostname,
String generationId,
int suggestedTimeToLiveSeconds,
int timeBufferPercentage)
Constructor for a IotHubSasTokenHsmAuthenticationProvider instance
|
void |
refreshSasToken()
Renew the saved sas token using the HSM unit
|
buildAudience, getSasToken, isAuthenticationProviderRenewalNecessarygetMillisecondsBeforeProactiveRenewal, getTokenValidSecs, setTokenValidSecs, shouldRefreshTokengetDeviceId, getGatewayHostname, getHostname, getIotHubTrustedCert, getModuleId, getPathToIotHubTrustedCert, getSSLContext, setIotHubTrustedCert, setPathToIotHubTrustedCert, setSSLContextpublic static IotHubSasTokenHsmAuthenticationProvider create(SignatureProvider signatureProvider, String deviceId, String moduleId, String hostname, String gatewayHostname, String generationId, int suggestedTimeToLiveSeconds, int timeBufferPercentage) throws IOException, TransportException
signatureProvider - the signature provider to be used when generating sas tokensdeviceId - the id of the device the module belongs tomoduleId - the id of the module to be authenticated forhostname - the hostname of the iothub to be authenticated for. May be null if gatewayHostname is notgatewayHostname - the gatewayHostname of the edge hub to be authenticated for. May be null if hostname is notgenerationId - the generation idsuggestedTimeToLiveSeconds - the time for the generated sas tokens to live fortimeBufferPercentage - the percent of the life a sas token will live before attempting to be renewed. (100 means don't renew until end of life)IOException - If the Hsm unit cannot be reachedTransportException - If the Hsm unit cannot be reachedpublic void refreshSasToken()
throws IOException,
TransportException
refreshSasToken in class IotHubSasTokenWithRefreshAuthenticationProviderIOException - If the Hsm unit cannot be reachedTransportException - If the Hsm unit cannot be reachedpublic boolean canRefreshToken()
canRefreshToken in class IotHubSasTokenAuthenticationProviderCopyright © 2020. All rights reserved.