# Class JsonWebSignature.Header (2.1.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.1.0 (latest)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebSignature.Header)
- [2.0.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/2.0.3/com.google.api.client.json.webtoken.JsonWebSignature.Header)
- [1.47.1](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.47.1/com.google.api.client.json.webtoken.JsonWebSignature.Header)
- [1.46.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.46.3/com.google.api.client.json.webtoken.JsonWebSignature.Header)
- [1.45.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.45.3/com.google.api.client.json.webtoken.JsonWebSignature.Header)
- [1.44.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.44.2/com.google.api.client.json.webtoken.JsonWebSignature.Header)
- [1.43.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.43.2/com.google.api.client.json.webtoken.JsonWebSignature.Header)
- [1.42.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.42.3/com.google.api.client.json.webtoken.JsonWebSignature.Header)
- [1.41.8](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.41.8/com.google.api.client.json.webtoken.JsonWebSignature.Header)

    public static class JsonWebSignature.Header extends JsonWebToken.Header

Header as specified in [Reserved
Header Parameter Names](https://tools.ietf.org/html/rfc7515#section-4.1).

## Inheritance

[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [AbstractMap](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html) \> [GenericData](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData) \> [GenericJson](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson) \> [JsonWebToken.Header](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Header) \> JsonWebSignature.Header

## Inherited Members

[GenericJson.getFactory()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson#com_google_api_client_json_GenericJson_getFactory__) [GenericJson.setFactory(JsonFactory)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson#com_google_api_client_json_GenericJson_setFactory_com_google_api_client_json_JsonFactory_) [GenericJson.toPrettyString()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson#com_google_api_client_json_GenericJson_toPrettyString__) [GenericJson.toString()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson#com_google_api_client_json_GenericJson_toString__) [JsonWebToken.Header.clone()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Header#com_google_api_client_json_webtoken_JsonWebToken_Header_clone__) [JsonWebToken.Header.getContentType()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Header#com_google_api_client_json_webtoken_JsonWebToken_Header_getContentType__) [JsonWebToken.Header.getType()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Header#com_google_api_client_json_webtoken_JsonWebToken_Header_getType__) [JsonWebToken.Header.set(String,Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Header#com_google_api_client_json_webtoken_JsonWebToken_Header_set_java_lang_String_java_lang_Object_) [JsonWebToken.Header.setContentType(String)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Header#com_google_api_client_json_webtoken_JsonWebToken_Header_setContentType_java_lang_String_) [JsonWebToken.Header.setType(String)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Header#com_google_api_client_json_webtoken_JsonWebToken_Header_setType_java_lang_String_) [GenericData.entrySet()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_entrySet__) [GenericData.equals(Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_equals_java_lang_Object_) [GenericData.get(Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_get_java_lang_Object_) [GenericData.getClassInfo()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_getClassInfo__) [GenericData.getUnknownKeys()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_getUnknownKeys__) [GenericData.hashCode()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_hashCode__) [GenericData.put(String,Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_put_java_lang_String_java_lang_Object_) [GenericData.putAll(Map\<? extends String,?\>)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_putAll_java_util_Map___extends_java_lang_String____) [GenericData.remove(Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_remove_java_lang_Object_) [GenericData.setUnknownKeys(Map\<String,Object\>)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_setUnknownKeys_java_util_Map_java_lang_String_java_lang_Object__) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-) [AbstractMap.clear()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#clear--) [AbstractMap.containsKey(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#containsKey-java.lang.Object-) [AbstractMap.containsValue(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#containsValue-java.lang.Object-) [AbstractMap.isEmpty()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#isEmpty--) [AbstractMap.keySet()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#keySet--) [AbstractMap.put(K,V)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#put-K-V-) [AbstractMap.putAll(Map\<? extends K,? extends V\>)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#putAll-java.util.Map<? extends K-? extends V>-) [AbstractMap.size()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#size--) [AbstractMap.values()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#values--)

## Constructors

### Header()

    public Header()

## Methods

### clone()

    public JsonWebSignature.Header clone()

Makes a "deep" clone of the generic data, in which the clone is completely independent of the
original.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebSignature.Header` |   |

**Overrides** [JsonWebToken.Header.clone()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Header#com_google_api_client_json_webtoken_JsonWebToken_Header_clone__)

### getAlgorithm()

    public final String getAlgorithm()

Returns the algorithm header parameter that identifies the cryptographic algorithm used to
secure the JWS or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getCritical()

    public final List<String> getCritical()

Returns an array listing the header parameter names that define extensions used in the JWS
header that MUST be understood and processed or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getJwk()

    public final String getJwk()

Returns the JSON Web Key header parameter that is a public key that corresponds to the key
used to digitally sign the JWS or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getJwkUrl()

    public final String getJwkUrl()

Returns the JSON Web Key URL header parameter that is an absolute URL that refers to a
resource for a set of JSON-encoded public keys, one of which corresponds to the key that was
used to digitally sign the JWS or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getKeyId()

    public final String getKeyId()

Returns the key ID header parameter that is a hint indicating which specific key owned by the
signer should be used to validate the digital signature or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getX509Certificates()

    public final List<String> getX509Certificates()

Returns the X.509 certificate chain header parameter contains the X.509 public key
certificate or certificate chain corresponding to the key used to digitally sign the JWS or
`null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getX509Thumbprint()

    public final String getX509Thumbprint()

Returns the X.509 certificate thumbprint header parameter that provides a base64url encoded
SHA-1 thumbprint (a.k.a. digest) of the DER encoding of an X.509 certificate that can be used
to match the certificate or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getX509Url()

    public final String getX509Url()

Returns the X.509 URL header parameter that is an absolute URL that refers to a resource for
the X.509 public key certificate or certificate chain corresponding to the key used to
digitally sign the JWS or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### set(String fieldName, Object value)

    public JsonWebSignature.Header set(String fieldName, Object value)

Sets the given field value (may be `null`) for the given field name. Any existing value
for the field will be overwritten. It may be more slightly more efficient than #put(String, Object) because it avoids accessing the field's original value.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `fieldName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebSignature.Header` |   |

**Overrides** [JsonWebToken.Header.set(String fieldName, Object value)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Header#com_google_api_client_json_webtoken_JsonWebToken_Header_set_java_lang_String_java_lang_Object_)

### setAlgorithm(String algorithm)

    public JsonWebSignature.Header setAlgorithm(String algorithm)

Sets the algorithm header parameter that identifies the cryptographic algorithm used to
secure the JWS or `null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `algorithm` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebSignature.Header` |   |

### setCritical(List\<String\> critical)

    public JsonWebSignature.Header setCritical(List<String> critical)

Sets the header parameter names that define extensions used in the JWS header that MUST be
understood and processed or `null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `critical` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebSignature.Header` |   |

### setJwk(String jwk)

    public JsonWebSignature.Header setJwk(String jwk)

Sets the JSON Web Key header parameter that is a public key that corresponds to the key used
to digitally sign the JWS or `null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `jwk` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebSignature.Header` |   |

### setJwkUrl(String jwkUrl)

    public JsonWebSignature.Header setJwkUrl(String jwkUrl)

Sets the JSON Web Key URL header parameter that is an absolute URL that refers to a resource
for a set of JSON-encoded public keys, one of which corresponds to the key that was used to
digitally sign the JWS or `null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `jwkUrl` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebSignature.Header` |   |

### setKeyId(String keyId)

    public JsonWebSignature.Header setKeyId(String keyId)

Sets the key ID header parameter that is a hint indicating which specific key owned by the
signer should be used to validate the digital signature or `null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `keyId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebSignature.Header` |   |

### setType(String type)

    public JsonWebSignature.Header setType(String type)

Sets the type header parameter used to declare the type of this object or `null` for
none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `type` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebSignature.Header` |   |

**Overrides** [JsonWebToken.Header.setType(String type)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Header#com_google_api_client_json_webtoken_JsonWebToken_Header_setType_java_lang_String_)

### setX509Certificates(List\<String\> x509Certificates)

    public JsonWebSignature.Header setX509Certificates(List<String> x509Certificates)

Sets the X.509 certificate chain header parameter contains the X.509 public key certificate
or certificate chain corresponding to the key used to digitally sign the JWS or `null`
for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `x509Certificates` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebSignature.Header` |   |

### setX509Thumbprint(String x509Thumbprint)

    public JsonWebSignature.Header setX509Thumbprint(String x509Thumbprint)

Sets the X.509 certificate thumbprint header parameter that provides a base64url encoded
SHA-1 thumbprint (a.k.a. digest) of the DER encoding of an X.509 certificate that can be used
to match the certificate or `null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `x509Thumbprint` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebSignature.Header` |   |

### setX509Url(String x509Url)

    public JsonWebSignature.Header setX509Url(String x509Url)

Sets the X.509 URL header parameter that is an absolute URL that refers to a resource for the
X.509 public key certificate or certificate chain corresponding to the key used to digitally
sign the JWS or `null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `x509Url` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebSignature.Header` |   |