Class AwsIotWebSocketUrlSigner
java.lang.Object
com.amazonaws.services.iot.client.util.AwsIotWebSocketUrlSigner
The AWSIotWebSocketUrlSigner class creates the SigV4 signature and builds a
connection URL to be used with the Paho MQTT client.
-
Constructor Summary
ConstructorsConstructorDescriptionAwsIotWebSocketUrlSigner(String endpoint) Deprecated.use provider-based constructorAwsIotWebSocketUrlSigner(String endpoint, CredentialsProvider provider, String region) Instantiate a new URL signer with endpoint, region and source of credentialsAwsIotWebSocketUrlSigner(String endpoint, String region) Instantiate a new URL signer with endpoint and region.AwsIotWebSocketUrlSigner(String endpoint, String awsAccessKeyId, String awsSecretAccessKey, String sessionToken) Instantiates a new URL signer instance with endpoint and credentials.AwsIotWebSocketUrlSigner(String endpoint, String awsAccessKeyId, String awsSecretAccessKey, String sessionToken, String region) Instantiates a new URL signer instance with endpoint and credentials. -
Method Summary
Modifier and TypeMethodDescriptiongetSignedUrl(Date signingDate) Given the signing date return a signed connection URL to be used when connecting via WebSocket to AWS IoT.voidupdateCredentials(String awsAccessKeyId, String awsSecretAccessKey, String sessionToken) Updates the signing credentials.
-
Constructor Details
-
AwsIotWebSocketUrlSigner
Deprecated.use provider-based constructorInstantiates a new URL signer instance with endpoint only.- Parameters:
endpoint- service endpoint with or without customer specific URL prefix.
-
AwsIotWebSocketUrlSigner
Instantiate a new URL signer with endpoint and region.- Parameters:
endpoint- service endpoint with or without customer specific URL prefix.region- The AWS region
-
AwsIotWebSocketUrlSigner
Instantiate a new URL signer with endpoint, region and source of credentials- Parameters:
endpoint- service endpoint with or without customer specific URL prefix.provider- credentials provider to source AWS credentials fromregion- The AWS region
-
AwsIotWebSocketUrlSigner
public AwsIotWebSocketUrlSigner(String endpoint, String awsAccessKeyId, String awsSecretAccessKey, String sessionToken) Instantiates a new URL signer instance with endpoint and credentials.- Parameters:
endpoint- service endpoint with or without customer specific URL prefix.awsAccessKeyId- AWS access key ID used in SigV4 signature algorithm.awsSecretAccessKey- AWS secret access key used in SigV4 signature algorithm.sessionToken- Session token for temporary credentials.
-
AwsIotWebSocketUrlSigner
public AwsIotWebSocketUrlSigner(String endpoint, String awsAccessKeyId, String awsSecretAccessKey, String sessionToken, String region) Instantiates a new URL signer instance with endpoint and credentials.- Parameters:
endpoint- service endpoint with or without customer specific URL prefix.awsAccessKeyId- AWS access key ID used in SigV4 signature algorithm.awsSecretAccessKey- AWS secret access key used in SigV4 signature algorithm.sessionToken- Session token for temporary credentials.region- The AWS region
-
-
Method Details
-
updateCredentials
public void updateCredentials(String awsAccessKeyId, String awsSecretAccessKey, String sessionToken) Updates the signing credentials.- Parameters:
awsAccessKeyId- AWS access key ID used in SigV4 signature algorithm.awsSecretAccessKey- AWS secret access key used in SigV4 signature algorithm.sessionToken- Session token for temporary credentials.
-
getSignedUrl
Given the signing date return a signed connection URL to be used when connecting via WebSocket to AWS IoT.- Parameters:
signingDate- time value to be used in SigV4 calculations. System current time will be used if null.- Returns:
- a URL with SigV4 signature formatted to be used with AWS IoT.
- Throws:
AWSIotException- Exception thrown when signed URL can be generated with given information.
-
getRegion
- Returns:
- the region this signer is configured to sign against
-