public static Key readKeyFromFile(String dir){
		FileInputStream fileInputStream=null;
		 
        File file = new File(dir);
 
        byte[] keyBytes = new byte[(int) file.length()];
 
        try {
        	fileInputStream = new FileInputStream(file);
        	fileInputStream.read(keyBytes);
        	fileInputStream.close();
        	
        	byte[] input = Hex.decode(keyBytes);
        	
	    	return new SecretKeySpec(input,"HmacSHA256");
        }catch(IOException e){
        	return null;
        }
	}