public String calculateRFC2104HMAC(String data, String key) throws Exception
	{
		String result;
		try
		{

			// get an hmac_sha1 key from the raw key bytes
			SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), "HmacSHA1");

			// get an hmac_sha1 Mac instance and initialize with the signing key
			Mac mac = Mac.getInstance("HmacSHA1");
			mac.init(signingKey);

			// compute the hmac on input data bytes
			byte[] rawHmac = mac.doFinal(data.getBytes());

			// base64-encode the hmac
			// result = Base64.encode(rawHmac);
			result = new String(Base64.encodeBase64(rawHmac));

			return result.trim();
		}
		catch (Exception e)
		{
			throw new SignatureException("Failed to generate HMAC : " + e.getMessage());
		}

		// return encodeUrl(result);
	}