Code example for SignatureException

0
			byte[] rawHmac = mac.doFinal(data.getBytes());
		 
			// base64-encode the hmac 
			result = Base64.encodeToString(rawHmac, false);
		} catch (Exception e) {
			throw new SignatureException("Failed to generate HMAC : " + e.getMessage());
		} 
		 
		return result;
	} 
	 
	private String responseToString(HttpResponse res) throws IllegalStateException, IOException {
    	InputStream is = res.getEntity().getContent();
        BufferedInputStream bis = new BufferedInputStream(is);
        ByteArrayBuffer baf = new ByteArrayBuffer(20);
 
         int current = 0;  
         while((current = bis.read()) != -1) 
                baf.append((byte)current);
            
        // Convert the Bytes read to a String.