public void setHmac(Key key){
		Mac hmac = null;
		try {
			hmac = Mac.getInstance("HmacSHA256");
		} catch (NoSuchAlgorithmException e) {
			System.err.println("NoSuchAlgorithmException (HmacSHA256 not valid): " + e.getMessage());
		}
		try {
			hmac.init(key);
		} catch (InvalidKeyException e) {
			System.err.println("InvalidKeyException: " + e.getMessage());
		}
		byte[] message = this.toString().getBytes();
		if(hmac!=null){
			hmac.update(message);
			byte[] hash = hmac.doFinal();
			base64hash = Base64.encode(hash);
		}
	}