Package org.forgerock.json.jose.builders
Class SignedJwtBuilderImpl
java.lang.Object
org.forgerock.json.jose.builders.AbstractJwtBuilder
org.forgerock.json.jose.builders.SignedJwtBuilderImpl
- All Implemented Interfaces:
JwtBuilder,SignedJwtBuilder
An implementation of a JwtBuilder that can build a JWT and sign it, resulting in a SignedJwt object.
- Since:
- 2.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionSignedJwtBuilderImpl(SigningHandler signingHandler) Constructs a new SignedJwtBuilderImpl that will use the given private key to sign the JWT. -
Method Summary
Modifier and TypeMethodDescriptionasJwt()Builds the JWT object from its constituent parts.build()Builds the JWS into aStringby calling thebuildmethod on the JWS object.claims(JwtClaimsSet claimsSet) Sets the JwtClaimsSet for this JwtBuilder.Deprecated.encrypt(EncryptionKey<?> encryptionKey) Wraps the signed JWT in an outer encrypted JWE envelope.headers()Gets the JwsHeaderBuilder that this JwtBuilder will use to build the JWS' header parameters.
-
Constructor Details
-
SignedJwtBuilderImpl
Constructs a new SignedJwtBuilderImpl that will use the given private key to sign the JWT.- Parameters:
signingHandler- The SigningHandler instance used to sign the JWS.
-
-
Method Details
-
headers
Gets the JwsHeaderBuilder that this JwtBuilder will use to build the JWS' header parameters.- Specified by:
headersin classAbstractJwtBuilder- Returns:
- The JwsHeaderBuilder instance.
-
claims
Sets the JwtClaimsSet for this JwtBuilder.- Overrides:
claimsin classAbstractJwtBuilder- Parameters:
claimsSet- The JwtClaimsSet containing the JWT's claims.- Returns:
- This SignedJwtBuilderImpl.
-
encrypt
Deprecated.Preferencrypt(EncryptionKey)instead.Wraps the signed JWT in an outer encrypted JWE envelope.- Parameters:
encryptionKey- the key to use for encryption. This should either be a symmetric secret key or a public key.- Returns:
- the nested encrypted signed JWT builder.
-
encrypt
Wraps the signed JWT in an outer encrypted JWE envelope.- Parameters:
encryptionKey- the key to use for encryption.- Returns:
- the nested encrypted signed JWT builder.
-
asJwt
Description copied from interface:JwtBuilderBuilds the JWT object from its constituent parts.- Specified by:
asJwtin interfaceJwtBuilder- Returns:
- The Jwt.
-
build
Builds the JWS into aStringby calling thebuildmethod on the JWS object.- Specified by:
buildin interfaceJwtBuilder- Returns:
- The base64url encoded UTF-8 parts of the JWS.
- See Also:
-
encrypt(EncryptionKey)instead.