Package overit.geocall.util
Class UrlSigner
java.lang.Object
overit.geocall.util.UrlSigner
Class used to sign an url with a HMAC-SHA1 key.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsignRequest(String requestUrl) Returns the requested url with the signing parameter
-
Constructor Details
-
UrlSigner
Creates a new UrlSigner.- Parameters:
keyString- The string containing the HMAC-SHA1 key.- Throws:
IOException- if the key cannot be decoded in Base64
-
-
Method Details
-
signRequest
public String signRequest(String requestUrl) throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException, URISyntaxException, MalformedURLException Returns the requested url with the signing parameter- Parameters:
requestUrl- The ulr of the request- Returns:
- The requested url with the signing parameter
- Throws:
NoSuchAlgorithmException- if the algorithm does not existsInvalidKeyException- if the key is not validUnsupportedEncodingException- if the key cannot be encodedURISyntaxException- if the uri sintax is wrongMalformedURLException- if the url is malformed
-