test_class.file: java_src/src/test/java/com/google/crypto/tink/jwt/ToBeSignedJwtTest.java
test_class.identifier: ToBeSignedJwtTest
test_case.body: @Test
    public void compact_success() throws Exception {
      // The encoded header -- the part before the first dot -- is copied from
      // https://tools.ietf.org/html/rfc7797#section-4.1.
      String expectedToken = "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJibGFoIn0";
      ToBeSignedJwt token = new ToBeSignedJwt.Builder().setJwtId("blah").build();
      String compact = token.compact("HS256");
  
      assertThat(compact).isEqualTo(expectedToken);
    }
test_case.class_method_signature: ToBeSignedJwtTest.compact_success()
test_case.full_signature: @Test public void compact_success()
test_case.identifier: compact_success
test_case.invocations: build setJwtId compact isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void compact_success()
focal_class.declarator: UTF_8 = Charset.forName("UTF-8")
focal_class.modifier: private static final
focal_class.original_string: private static final Charset UTF_8 = Charset.forName("UTF-8");
focal_class.type: Charset
focal_class.var_name: UTF_8
focal_class.declarator: header
focal_class.modifier: @SuppressWarnings("Immutable") // We do not mutate the header.
    private final
focal_class.original_string: @SuppressWarnings("Immutable") // We do not mutate the header.
    private final JSONObject header;
focal_class.type: JSONObject
focal_class.var_name: header
focal_class.declarator: payload
focal_class.modifier: @SuppressWarnings("Immutable") // We do not mutate the payload.
    private final
focal_class.original_string: @SuppressWarnings("Immutable") // We do not mutate the payload.
    private final JSONObject payload;
focal_class.type: JSONObject
focal_class.var_name: payload
focal_class.file: java_src/src/main/java/com/google/crypto/tink/jwt/ToBeSignedJwt.java
focal_class.identifier: ToBeSignedJwt
focal_class.class_method_signature: ToBeSignedJwt.ToBeSignedJwt(Builder builder)
focal_class.full_signature: private  ToBeSignedJwt(Builder builder)
focal_class.identifier: ToBeSignedJwt
focal_class.modifiers: private
focal_class.parameters: (Builder builder)
focal_class.signature:  ToBeSignedJwt(Builder builder)
focal_class.class_method_signature: ToBeSignedJwt.getHeader(String name)
focal_class.full_signature:  String getHeader(String name)
focal_class.identifier: getHeader
focal_class.parameters: (String name)
focal_class.return: String
focal_class.signature: String getHeader(String name)
focal_class.class_method_signature: ToBeSignedJwt.getHeader()
focal_class.full_signature:  JSONObject getHeader()
focal_class.identifier: getHeader
focal_class.parameters: ()
focal_class.return: JSONObject
focal_class.signature: JSONObject getHeader()
focal_class.class_method_signature: ToBeSignedJwt.getPayload()
focal_class.full_signature:  JSONObject getPayload()
focal_class.identifier: getPayload
focal_class.parameters: ()
focal_class.return: JSONObject
focal_class.signature: JSONObject getPayload()
focal_class.class_method_signature: ToBeSignedJwt.getClaim(String name)
focal_class.full_signature:  Object getClaim(String name)
focal_class.identifier: getClaim
focal_class.parameters: (String name)
focal_class.return: Object
focal_class.signature: Object getClaim(String name)
focal_class.class_method_signature: ToBeSignedJwt.getAlgorithm()
focal_class.full_signature:  String getAlgorithm()
focal_class.identifier: getAlgorithm
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getAlgorithm()
focal_class.class_method_signature: ToBeSignedJwt.getAudiences()
focal_class.full_signature:  List<String> getAudiences()
focal_class.identifier: getAudiences
focal_class.parameters: ()
focal_class.return: List<String>
focal_class.signature: List<String> getAudiences()
focal_class.class_method_signature: ToBeSignedJwt.getInstant(String name)
focal_class.full_signature: private Instant getInstant(String name)
focal_class.identifier: getInstant
focal_class.modifiers: private
focal_class.parameters: (String name)
focal_class.return: Instant
focal_class.signature: Instant getInstant(String name)
focal_class.class_method_signature: ToBeSignedJwt.getExpiration()
focal_class.full_signature:  Instant getExpiration()
focal_class.identifier: getExpiration
focal_class.parameters: ()
focal_class.return: Instant
focal_class.signature: Instant getExpiration()
focal_class.class_method_signature: ToBeSignedJwt.getNotBefore()
focal_class.full_signature:  Instant getNotBefore()
focal_class.identifier: getNotBefore
focal_class.parameters: ()
focal_class.return: Instant
focal_class.signature: Instant getNotBefore()
focal_class.class_method_signature: ToBeSignedJwt.getIssuedAt()
focal_class.full_signature:  Instant getIssuedAt()
focal_class.identifier: getIssuedAt
focal_class.parameters: ()
focal_class.return: Instant
focal_class.signature: Instant getIssuedAt()
focal_class.class_method_signature: ToBeSignedJwt.compact(String alg)
focal_class.full_signature:  String compact(String alg)
focal_class.identifier: compact
focal_class.parameters: (String alg)
focal_class.return: String
focal_class.signature: String compact(String alg)
focal_method.body: String compact(String alg) {
      JSONObject copy;
  
      try {
        copy = new JSONObject(this.header.toString());
        copy.put(JwtNames.HEADER_ALGORITHM, alg);
      } catch (JSONException ex) {
        // Should never happen.
        throw new IllegalStateException(ex);
      }
  
      String headerStr = Base64.urlSafeEncode(copy.toString().getBytes(UTF_8));
      String payloadStr = Base64.urlSafeEncode(this.payload.toString().getBytes(UTF_8));
      return headerStr + "." + payloadStr;
    }
focal_method.class_method_signature: ToBeSignedJwt.compact(String alg)
focal_method.full_signature:  String compact(String alg)
focal_method.identifier: compact
focal_method.invocations: toString put urlSafeEncode getBytes toString urlSafeEncode getBytes toString
focal_method.parameters: (String alg)
focal_method.return: String
focal_method.signature: String compact(String alg)