code: protected String internalGenerate(final JWTClaimsSet claimsSet) {
          JWT jwt;
          // signature?
          if (signatureConfiguration == null) {
              jwt = new PlainJWT(claimsSet);
          } else {
              jwt = signatureConfiguration.sign(claimsSet);
          }
  
          // encryption?
          if (encryptionConfiguration != null) {
              return encryptionConfiguration.encrypt(jwt);
          } else {
              return jwt.serialize();
          }
      }
docs: Generate a JWT from a claims set.
  
  @param claimsSet the claims set
  @return the JWT