code: public WwwAuthenticateHeader createWwwAuthenticateHeader()
  			throws HawkException {
  
  		WwwAuthenticateBuilder headerBuilder = WwwAuthenticateHeader
  				.wwwAuthenticate();
  
  		if (hasTs()) {
  			if (!hasTsm()) {
  				String hmac = this.generateHmac();
  				headerBuilder.ts(getTs()).tsm(hmac);
  			} else {
  				headerBuilder.ts(getTs()).tsm(getTsm());
  			}
  			if(hasError()) {
  				throw new IllegalStateException("Context cannot contain error and ts at the same time.");
  			}
  		}
  		if(hasError()) {
  			headerBuilder.error(this.error);
  		}
  
  
  		return headerBuilder.build();
  	}
docs: Create a WWW-Authenticate header from this HawkWwwAuthenticateContext.
  
  The method returns a new WwwAuthenticateHeader instance from the data
  contained in this HawkWwwAuthenticateContext.
  <p>
  If the context has a timestamp but no timestamp HMAC, a new HMAC for the
  timestamp is created using the supplied credentials.
  
  @see net.jalg.hawkj.WwwAuthenticateHeader
  
  @return The newly created header object.
  @throws HawkException