Class EncryptedJwtBuilder

java.lang.Object
org.forgerock.json.jose.builders.AbstractJwtBuilder
org.forgerock.json.jose.builders.EncryptedJwtBuilder
All Implemented Interfaces:
JwtBuilder
Direct Known Subclasses:
SignedThenEncryptedJwtBuilder

public class EncryptedJwtBuilder extends AbstractJwtBuilder
An implementation of a JwtBuilder that can build a JWT and encrypt it, resulting in an EncryptedJwt object.
Since:
2.0.0
  • Constructor Details

  • Method Details

    • headers

      public JweHeaderBuilder<? extends EncryptedJwtBuilder> headers()
      Gets the JweHeaderBuilder that this JwtBuilder will use to build the JWE's header parameters.
      Specified by:
      headers in class AbstractJwtBuilder
      Returns:
      The JweHeaderBuilder instance.
    • claims

      public EncryptedJwtBuilder claims(JwtClaimsSet claimsSet)
      Sets the JwtClaimsSet for this JwtBuilder.
      Overrides:
      claims in class AbstractJwtBuilder
      Parameters:
      claimsSet - The JwtClaimsSet containing the JWT's claims.
      Returns:
      This EncryptedJwtBuilder.
    • sign

      @Deprecated public SignedEncryptedJwtBuilder sign(SigningHandler signingHandler, JwsAlgorithm jwsAlgorithm)
      Returns a SignedEncryptedJwtBuilder that will build a signed JWT with this builder's encrypted JWT as its payload.
      Parameters:
      signingHandler - The SigningHandler instance used to sign the JWS.
      jwsAlgorithm - The JwsAlgorithm to use when signing the JWT.
      Returns:
      The SignedEncryptedJwtBuilder instance.
    • signedWith

      public EncryptedThenSignedJwtBuilder signedWith(SigningHandler signingHandler, JwsAlgorithm jwsAlgorithm)
      Returns an EncryptedThenSignedJwtBuilder that will build a signed JWT with this builder's encrypted JWT as its payload.
      Parameters:
      signingHandler - The SigningHandler instance used to sign the JWS.
      jwsAlgorithm - The JwsAlgorithm to use when signing the JWT.
      Returns:
      The EncryptedThenSignedJwtBuilder instance.
    • asJwt

      public EncryptedJwt asJwt()
      Description copied from interface: JwtBuilder
      Builds the JWT object from its constituent parts.
      Returns:
      The Jwt.
    • build

      public String build()
      Builds the JWE into a String by calling the build method on the JWE object.

      Returns:
      The base64url encoded UTF-8 parts of the JWE.
      See Also: