Package org.forgerock.json.jose.builders
Class JwtSecureHeaderBuilder<T extends JwtBuilder,B extends JwtSecureHeaderBuilder<T,B>>
- java.lang.Object
-
- org.forgerock.json.jose.builders.JwtHeaderBuilder<T,B>
-
- org.forgerock.json.jose.builders.JwtSecureHeaderBuilder<T,B>
-
- Type Parameters:
T
- the type of JwtBuilder that parents this JwtHeaderBuilder.B
- the type of this JwtHeaderBuilder
- Direct Known Subclasses:
EncryptedThenSignedJwtHeaderBuilder
,JweHeaderBuilder
,JwsHeaderBuilder
public abstract class JwtSecureHeaderBuilder<T extends JwtBuilder,B extends JwtSecureHeaderBuilder<T,B>> extends JwtHeaderBuilder<T,B>
A base implementation of a JWT header builder, for the common security header parameters shared by the JWS and JWE headers, that provides a fluent builder pattern to creating JWT headers.See
JwtSecureHeader
for information on the JwtSecureHeader object that this builder creates.- Since:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description JwtSecureHeaderBuilder(T jwtBuilder)
Constructs a new JwtSecureHeaderBuilder, parented by the given JwtBuilder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description B
crit(List<String> crit)
Sets the critical header parameters for this JWS.B
cty(String cty)
Sets the content type header parameter for this JWS.B
jku(URL jku)
Sets the JWK Set URL header parameter for this JWS.B
jwk(JWK jwk)
Sets the JSON Web Key header parameter for this JWS.B
kid(String kid)
Sets the Key ID header parameter for this JWS.B
x5c(List<String> x5c)
Sets the X.509 Certificate Chain header parameter for this JWS.B
x5t(String x5t)
Sets the X.509 Certificate Thumbprint header parameter for this JWS.B
x5u(URL x5u)
Sets the X.509 URL header parameter for this JWS.B
zip(CompressionAlgorithm zip)
Sets the Compression Algorithm header parameter for this JWE.-
Methods inherited from class org.forgerock.json.jose.builders.JwtHeaderBuilder
alg, build, done, getHeaders, header, headerIfNotNull
-
-
-
-
Constructor Detail
-
JwtSecureHeaderBuilder
public JwtSecureHeaderBuilder(T jwtBuilder)
Constructs a new JwtSecureHeaderBuilder, parented by the given JwtBuilder.- Parameters:
jwtBuilder
- The JwtBuilder instance that this JwtSecureHeaderBuilder is a child of.
-
-
Method Detail
-
jku
public B jku(URL jku)
Sets the JWK Set URL header parameter for this JWS.- Parameters:
jku
- The JWK Set URL.- Returns:
- This JwtSecureHeaderBuilder.
- See Also:
JwtSecureHeader.setJwkSetUrl(java.net.URL)
-
jwk
public B jwk(JWK jwk)
Sets the JSON Web Key header parameter for this JWS.- Parameters:
jwk
- The JSON Web Key.- Returns:
- This JwtSecureHeaderBuilder.
- See Also:
JwtSecureHeader.setJsonWebKey(org.forgerock.json.jose.jwk.JWK)
-
x5u
public B x5u(URL x5u)
Sets the X.509 URL header parameter for this JWS.- Parameters:
x5u
- THe X.509 URL.- Returns:
- This JwtSecureHeaderBuilder.
- See Also:
JwtSecureHeader.setX509Url(java.net.URL)
-
x5t
public B x5t(String x5t)
Sets the X.509 Certificate Thumbprint header parameter for this JWS.- Parameters:
x5t
- The X.509 Certificate Thumbprint.- Returns:
- This JwtSecureHeaderBuilder.
- See Also:
JwtSecureHeader.setX509CertificateThumbprint(String)
-
x5c
public B x5c(List<String> x5c)
Sets the X.509 Certificate Chain header parameter for this JWS.- Parameters:
x5c
- The X.509 Certificate Chain.- Returns:
- This JwtSecureHeaderBuilder.
- See Also:
JwtSecureHeader.setX509CertificateChain(java.util.List)
-
kid
public B kid(String kid)
Sets the Key ID header parameter for this JWS.- Parameters:
kid
- The Key ID.- Returns:
- This JwtSecureHeaderBuilder.
- See Also:
JwtSecureHeader.setKeyId(String)
-
cty
public B cty(String cty)
Sets the content type header parameter for this JWS.- Parameters:
cty
- The content type of the JWS payload.- Returns:
- This JwtSecureHeaderBuilder.
- See Also:
JwtSecureHeader.setContentType(String)
-
crit
public B crit(List<String> crit)
Sets the critical header parameters for this JWS.- Parameters:
crit
- A List of the JWS critical parameters.- Returns:
- This JwtSecureHeaderBuilder.
- See Also:
JwtSecureHeader.setCriticalHeaders(java.util.List)
-
zip
public B zip(CompressionAlgorithm zip)
Sets the Compression Algorithm header parameter for this JWE.- Parameters:
zip
- The Compression Algorithm.- Returns:
- This JweHeaderBuilder.
- See Also:
JwtSecureHeader.setCompressionAlgorithm(CompressionAlgorithm)
-
-