T
- the mutator subtype, for method chainingpublic interface ProtectedHeaderMutator<T extends ProtectedHeaderMutator<T>> extends HeaderMutator<T>, X509Mutator<T>
Header
instance.Modifier and Type | Method and Description |
---|---|
NestedCollection<String,T> |
critical()
Configures names of header parameters used by JWT or JWA specification extensions that MUST be
understood and supported by the JWT recipient.
|
T |
jwk(PublicJwk<?> jwk)
Sets the
jwk (JSON Web Key) associated with the JWT. |
T |
jwkSetUrl(URI uri)
Sets the
jku (JWK Set URL) value that refers to a
JWK Set
resource containing JSON-encoded Public Keys, or null if not present. |
T |
keyId(String kid)
Sets the JWT case-sensitive
kid (Key ID) header value. |
T |
setAlgorithm(String alg)
Deprecated.
since 0.12.0 and will be removed before the 1.0 release.
|
T |
setKeyId(String kid)
Deprecated.
since 0.12.0 in favor of the more modern builder-style
keyId(String) method. |
contentType, setCompressionAlgorithm, setContentType, setType, type
add, add, delete, empty
x509Chain, x509Sha1Thumbprint, x509Sha256Thumbprint, x509Url
NestedCollection<String,T> critical()
and()
method to continue header configuration, for example:
headerBuilder .critical().add("headerName").and()
// return parent // resume header configuration...
NestedCollection
to use for crit
configuration.crit
(Critical) Header Parameter,
JWS crit
(Critical) Header ParameterT jwk(PublicJwk<?> jwk)
jwk
(JSON Web Key) associated with the JWT. When set for a JwsHeader
, the
jwk
is the public key complement of the private key used to digitally sign the JWS. When set for a
JweHeader
, the jwk
is the public key to which the JWE was encrypted, and may be used to
determine the private key needed to decrypt the JWE.jwk
- the jwk
(JSON Web Key) associated with the header.jwk
(JSON Web Key) Header Parameter,
JWE jwk
(JSON Web Key) Header ParameterT jwkSetUrl(URI uri)
jku
(JWK Set URL) value that refers to a
JWK Set
resource containing JSON-encoded Public Keys, or null
if not present. When set for a
JwsHeader
, the first public key in the JWK Set must be the public key complement of the
private key used to sign the JWS. When set for a JweHeader
, the first public key in the JWK Set
must be the public key used during encryption.uri
- a URI that refers to a JWK Set
resource containing JSON-encoded Public KeysT keyId(String kid)
kid
(Key ID) header value. A null
value will remove the property
from the JSON map.
The keyId header parameter is a hint indicating which key was used to secure a JWS or JWE. This parameter allows originators to explicitly signal a change of key to recipients. The structure of the keyId value is unspecified. Its value MUST be a case-sensitive string.
When used with a JWK, the keyId value is used to match a JWK keyId
parameter value.
kid
- the case-sensitive JWS kid
header value or null
to remove the property from the JSON map.@Deprecated T setKeyId(String kid)
keyId(String)
method.keyId(String)
.kid
- the case-sensitive JWS kid
header value or null
to remove the property from the JSON map.@Deprecated T setAlgorithm(String alg)
JwtBuilder
will
always set the alg
header as necessary.alg
- the JWS or JWE algorithm alg
value or null
to remove the property from the JSON map.Copyright © 2014–2025 jsonwebtoken.io. All rights reserved.