Package org.forgerock.json.jose.builders
Class EncryptedThenSignedJwtBuilder
- java.lang.Object
-
- org.forgerock.json.jose.builders.AbstractJwtBuilder
-
- org.forgerock.json.jose.builders.EncryptedThenSignedJwtBuilder
-
- All Implemented Interfaces:
JwtBuilder
,SignedJwtBuilder
- Direct Known Subclasses:
SignedEncryptedJwtBuilder
public class EncryptedThenSignedJwtBuilder extends AbstractJwtBuilder implements SignedJwtBuilder
An implementation of a JwtBuilder that can build a JWT and encrypt it and nest it within another signed JWT, resulting in an SignedEncryptedJwt object.- Since:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description EncryptedThenSignedJwtBuilder(EncryptedJwtBuilder encryptedJwtBuilder, SigningHandler signingHandler, JwsAlgorithm jwsAlgorithm)
Constructs a new SignedEncryptedJwtBuilder that will use the given EncryptedJwtBuilder, to build the nested Encrypted JWT, and the private key and JwsAlgorithm to sign the outer JWT.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SignedJwt
asJwt()
Builds the JWT object from its constituent parts.String
build()
Builds the JWS into aString
by calling thebuild
method on the JWS object.EncryptedThenSignedJwtHeaderBuilder
headers()
Gets the JwtHeaderBuilder that this JwtBuilder will use to build the JWT's header parameters.-
Methods inherited from class org.forgerock.json.jose.builders.AbstractJwtBuilder
claims
-
-
-
-
Constructor Detail
-
EncryptedThenSignedJwtBuilder
public EncryptedThenSignedJwtBuilder(EncryptedJwtBuilder encryptedJwtBuilder, SigningHandler signingHandler, JwsAlgorithm jwsAlgorithm)
Constructs a new SignedEncryptedJwtBuilder that will use the given EncryptedJwtBuilder, to build the nested Encrypted JWT, and the private key and JwsAlgorithm to sign the outer JWT.- Parameters:
encryptedJwtBuilder
- The EncryptedJwtBuilder instance.signingHandler
- The SigningHandler instance used to sign the JWS.jwsAlgorithm
- The JwsAlgorithm to use when signing the JWT.
-
-
Method Detail
-
asJwt
public SignedJwt asJwt()
Description copied from interface:JwtBuilder
Builds the JWT object from its constituent parts.- Specified by:
asJwt
in interfaceJwtBuilder
- Returns:
- The Jwt.
-
build
public String build()
Builds the JWS into aString
by calling thebuild
method on the JWS object.- Specified by:
build
in interfaceJwtBuilder
- Returns:
- The base64url encoded UTF-8 parts of the JWS.
- See Also:
SignedJwt.build()
-
headers
public EncryptedThenSignedJwtHeaderBuilder headers()
Description copied from class:AbstractJwtBuilder
Gets the JwtHeaderBuilder that this JwtBuilder will use to build the JWT's header parameters.- Specified by:
headers
in classAbstractJwtBuilder
- Returns:
- The JwtHeaderBuilder instance.
-
-