public class IotHubSasTokenHsmAuthenticationProvider extends IotHubSasTokenWithRefreshAuthenticationProvider
sasToken, tokenValidSecsdeviceId, gatewayHostname, hostname, moduleId| Modifier and Type | Method and Description |
|---|---|
boolean |
canRefreshToken()
Returns true as the Hsm can always refresh the token
|
static IotHubSasTokenHsmAuthenticationProvider |
create(SignatureProvider signatureProvider,
java.lang.String deviceId,
java.lang.String moduleId,
java.lang.String hostname,
java.lang.String gatewayHostname,
java.lang.String generationId,
int suggestedTimeToLiveSeconds,
int timeBufferPercentage)
Constructor for a IotHubSasTokenHsmAuthenticationProvider instance
|
static IotHubSasTokenHsmAuthenticationProvider |
create(SignatureProvider signatureProvider,
java.lang.String deviceId,
java.lang.String moduleId,
java.lang.String hostname,
java.lang.String gatewayHostname,
java.lang.String generationId,
int suggestedTimeToLiveSeconds,
int timeBufferPercentage,
javax.net.ssl.SSLContext sslContext)
Constructor for a IotHubSasTokenHsmAuthenticationProvider instance
|
void |
refreshSasToken()
Renew the saved sas token using the HSM unit
|
buildAudience, getSasToken, isAuthenticationProviderRenewalNecessarygetMillisecondsBeforeProactiveRenewal, getTokenValidSecs, isSasTokenExpired, setTokenValidSecs, shouldRefreshTokengetDeviceId, getGatewayHostname, getHostname, getModuleId, getSSLContextpublic static IotHubSasTokenHsmAuthenticationProvider create(SignatureProvider signatureProvider, java.lang.String deviceId, java.lang.String moduleId, java.lang.String hostname, java.lang.String gatewayHostname, java.lang.String generationId, int suggestedTimeToLiveSeconds, int timeBufferPercentage) throws java.io.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)java.io.IOException - If the Hsm unit cannot be reachedTransportException - If the Hsm unit cannot be reachedpublic static IotHubSasTokenHsmAuthenticationProvider create(SignatureProvider signatureProvider, java.lang.String deviceId, java.lang.String moduleId, java.lang.String hostname, java.lang.String gatewayHostname, java.lang.String generationId, int suggestedTimeToLiveSeconds, int timeBufferPercentage, javax.net.ssl.SSLContext sslContext) throws java.io.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)sslContext - the SSLContext to open connections withjava.io.IOException - If the Hsm unit cannot be reachedTransportException - If the Hsm unit cannot be reachedpublic void refreshSasToken()
throws java.io.IOException,
TransportException
refreshSasToken in class IotHubSasTokenWithRefreshAuthenticationProviderjava.io.IOException - If the Hsm unit cannot be reachedTransportException - If the Hsm unit cannot be reachedpublic boolean canRefreshToken()
canRefreshToken in class IotHubSasTokenAuthenticationProviderCopyright © 2023. All rights reserved.