Package org.forgerock.json.jose.builders
Class JweHeaderBuilder<B extends EncryptedJwtBuilder>
- java.lang.Object
-
- org.forgerock.json.jose.builders.JwtHeaderBuilder<T,B>
-
- org.forgerock.json.jose.builders.JwtSecureHeaderBuilder<B,JweHeaderBuilder<B>>
-
- org.forgerock.json.jose.builders.JweHeaderBuilder<B>
-
- Type Parameters:
B
- the concrete JWT builder type that headers are being built for.
public class JweHeaderBuilder<B extends EncryptedJwtBuilder> extends JwtSecureHeaderBuilder<B,JweHeaderBuilder<B>>
An implementation of a JWE Header builder that provides a fluent builder pattern to create JWE headers.See
JweHeader
for information on the JweHeader object that this builder creates.- Since:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description JweHeaderBuilder(B jwtBuilder)
Constructs a new JweHeaderBuilder, parented by the given JwtBuilder.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description JweHeaderBuilder<B>
apu(String apu)
Sets the Agreement PartyUInfo header parameter for this JWE.JweHeaderBuilder<B>
apv(String apv)
Sets the Agreement PartyVInfo header parameter for this JWE.protected JwtHeader
build()
Creates a JweHeader instance from the header parameters set in this builder.JweHeaderBuilder<B>
enc(EncryptionMethod enc)
Sets the Encryption Method header parameter for this JWE.JweHeaderBuilder<B>
epk(String epk)
Deprecated.Useepk(JWK)
instead.JweHeaderBuilder<B>
epk(JWK epk)
Sets the Ephemeral Public Key header parameter for this JWE.JweHeaderBuilder<B>
zip(CompressionAlgorithm zip)
Sets the Compression Algorithm header parameter for this JWE.-
Methods inherited from class org.forgerock.json.jose.builders.JwtSecureHeaderBuilder
crit, cty, jku, jwk, kid, x5c, x5t, x5u
-
Methods inherited from class org.forgerock.json.jose.builders.JwtHeaderBuilder
alg, done, getHeaders, header, headerIfNotNull
-
-
-
-
Constructor Detail
-
JweHeaderBuilder
public JweHeaderBuilder(B jwtBuilder)
Constructs a new JweHeaderBuilder, parented by the given JwtBuilder.- Parameters:
jwtBuilder
- The JwtBuilder instance that this JweHeaderBuilder is a child of.
-
-
Method Detail
-
enc
public JweHeaderBuilder<B> enc(EncryptionMethod enc)
Sets the Encryption Method header parameter for this JWE.- Parameters:
enc
- The Encryption Method.- Returns:
- This JweHeaderBuilder.
- See Also:
JweHeader.setEncryptionMethod(org.forgerock.json.jose.jwe.EncryptionMethod)
-
epk
public JweHeaderBuilder<B> epk(JWK epk)
Sets the Ephemeral Public Key header parameter for this JWE.- Parameters:
epk
- The Ephemeral Public Key.- Returns:
- This JweHeaderBuilder.
- See Also:
JweHeader.setEphemeralPublicKey(org.forgerock.json.jose.jwk.JWK)
-
epk
@Deprecated public JweHeaderBuilder<B> epk(String epk)
Deprecated.Useepk(JWK)
instead.Sets the Ephemeral Public Key header parameter for this JWE.- Parameters:
epk
- The Ephemeral Public Key.- Returns:
- This JweHeaderBuilder.
- See Also:
JweHeader.setEphemeralPublicKey(org.forgerock.json.jose.jwk.JWK)
-
zip
public JweHeaderBuilder<B> zip(CompressionAlgorithm zip)
Description copied from class:JwtSecureHeaderBuilder
Sets the Compression Algorithm header parameter for this JWE.- Overrides:
zip
in classJwtSecureHeaderBuilder<B extends EncryptedJwtBuilder,JweHeaderBuilder<B extends EncryptedJwtBuilder>>
- Parameters:
zip
- The Compression Algorithm.- Returns:
- This JweHeaderBuilder.
- See Also:
JwtSecureHeader.setCompressionAlgorithm(CompressionAlgorithm)
-
apu
public JweHeaderBuilder<B> apu(String apu)
Sets the Agreement PartyUInfo header parameter for this JWE.- Parameters:
apu
- The Agreement PartyUInfo.- Returns:
- This JweHeaderBuilder.
- See Also:
JweHeader.setAgreementPartyUInfo(String)
-
apv
public JweHeaderBuilder<B> apv(String apv)
Sets the Agreement PartyVInfo header parameter for this JWE.- Parameters:
apv
- The Agreement PartyVInfo.- Returns:
- This JweHeaderBuilder.
- See Also:
JweHeader.setAgreementPartyVInfo(String)
-
build
protected JwtHeader build()
Creates a JweHeader instance from the header parameters set in this builder.- Specified by:
build
in classJwtHeaderBuilder<B extends EncryptedJwtBuilder,JweHeaderBuilder<B extends EncryptedJwtBuilder>>
- Returns:
- A JweHeader instance.
-
-