public HawkWwwAuthenticateContext build() throws HawkException {

			/*
			 * If this is a builder for/from a header that has a ts-parameter...
			 * (tsm can be set (when parsed from header) or null, in which case
			 * it will be generated when a header is built from us.
			 */
			if (this.ts != 0) {
				/*
				 * Since we do mac-ing of the timestamp, when generating for
				 * header or when validating from header with us, we need
				 * credentials in the context.
				 */
				if (this.id == null || this.key == null
						|| this.algorithm == null) {
					throw new IllegalStateException("Null or empty key not allowed");
				}

				if(this.error != null) {
					throw new IllegalStateException("Hawk does not allow ts and error parameters together.");
				}
				/*
				 * Create a new context for WWW-Authenticate headers that
				 * communicate a current timestamp to the client.
				 */
				return new HawkWwwAuthenticateContext(this.ts, this.tsm,
						this.id, this.key, this.algorithm);

			}
			/*
			 * If this is a builder for error WWW-Authenticate headers, construct
			 * a context containing the error.
			 */
			if( this.error != null) {
				return new HawkWwwAuthenticateContext(this.error);
			}

			/*
			 * Sometimes we do have an empty builder, because just 'Hawk' is a
			 * valid WWW-Authenticate header value for Hawk 401 responses.
			 */
			return new HawkWwwAuthenticateContext();
		}